home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_plotutils.idb / usr / freeware / info / plotutils.info.z / plotutils.info
Encoding:
GNU Info File  |  1998-10-28  |  325.4 KB  |  8,033 lines

  1. This is Info file plotutils.info, produced by Makeinfo version 1.68
  2. from the input file plotutils.texi.
  3.  
  4. INFO-DIR-SECTION GNU Plotting Utilities
  5. START-INFO-DIR-ENTRY
  6. * Plotting utilities: (plotutils).      GNU plotting utilities
  7. * graph: (plotutils)graph Invocation.   Plot datasets, possibly in real time
  8. * plot: (plotutils)plot Invocation.     Convert and display plot files
  9. * tek2plot: (plotutils)tek2plot Invocation.   Translate legacy Tektronix data
  10. * plotfont: (plotutils)plotfont Invocation.   Plot character maps of fonts
  11. * spline: (plotutils)spline Invocation. Interpolate between points in datasets
  12. * ode: (plotutils)ode Invocation.       Integrate differential equations
  13. * libplot: (plotutils)libplot.          A library for 2-D vector graphics
  14. * Appendices: (plotutils)Appendices.    More info on the plotting utilities
  15. END-INFO-DIR-ENTRY
  16.  
  17.    This file documents version 2.1.4 of the GNU plotting utilities
  18. package, including GNU libplot 1.4
  19.  
  20.    Copyright (C) 1989-1998 Free Software Foundation, Inc.
  21.  
  22.    Permission is granted to make and distribute verbatim copies of this
  23. manual provided the copyright notice and this permission notice are
  24. preserved on all copies.
  25.  
  26.    Permission is granted to copy and distribute modified versions of
  27. this manual under the conditions for verbatim copying, provided that
  28. the entire resulting derived work is distributed under the terms of a
  29. permission notice identical to this one.
  30.  
  31.    Permission is granted to copy and distribute translations of this
  32. manual into another language, under the above conditions for modified
  33. versions, except that this permission notice may be stated in a
  34. translation approved by the Foundation.
  35.  
  36. 
  37. File: plotutils.info,  Node: Top,  Next: Plotutils Intro,  Prev: (dir),  Up: (dir)
  38.  
  39.    This is the documentation for version 2.1.4 of the GNU plotting
  40. utilities package, including GNU libplot 1.4.  The package consists of
  41. programs and functions for data plotting and vector graphics.
  42.  
  43. * Menu:
  44.  
  45. * Plotutils Intro::     GNU plotting utilities
  46. * graph::               graph, a program for plotting datasets
  47. * plot::                plot, a plot format conversion program
  48. * tek2plot::            tek2plot, a translator for legacy Tektronix files
  49. * plotfont::            plotfont, a program for plotting font character maps
  50. * spline::              spline, an interpolation program
  51. * ode::                 ode, a differential equation integrator
  52. * libplot::             A library for device-independent 2-D vector graphics
  53. * Appendices::          Additional Information
  54.  
  55. 
  56. File: plotutils.info,  Node: Plotutils Intro,  Next: graph,  Prev: Top,  Up: Top
  57.  
  58. The GNU Plotting Utilities
  59. **************************
  60.  
  61.    The GNU plotting utilities currently consist of seven user-level
  62. programs: `graph', `plot', `tek2plot', `plotfont', `spline', `ode', and
  63. `double'.  Distributed along with them is GNU `libplot', a function
  64. library for device-independent two-dimensional vector graphics,
  65. including vector graphics animations under the X Window System.
  66.  
  67.    `graph' is a program for plotting two-dimensional scientific data.
  68. It reads one or more data files containing datasets, and outputs a plot.
  69. The plot can be directed to a display device or to a file.  Six
  70. different display types or output formats are supported.  The
  71. corresponding commands are `graph -T X', `graph -T ps', `graph -T fig',
  72. `graph -T hpgl', `graph -T tek', and `graph'.
  73.  
  74.    `graph -T X' pops up a window on an X Window System display, and
  75. draws the plot in it.  `graph -T ps' produces a plot in encapsulated
  76. Postscript format that may be included in another document, edited with
  77. the `idraw' drawing editor, or sent directly to a printer.  `graph -T
  78. fig' produces output that may be displayed and edited with the `xfig'
  79. drawing editor.  `graph -T hpgl' produces a Hewlett-Packard Graphics
  80. Language (HP-GL or HP-GL/2) plot that may be sent to a Hewlett-Packard
  81. LaserJet printer or plotter, or included in another document.  `graph
  82. -T tek' produces output that may be displayed on a Tektronix 4014
  83. terminal or emulator.  `graph' without a `-T' option (referred to as
  84. `raw `graph'') produces output in a device-independent format,
  85. a so-called GNU graphics metafile.  This metafile may be translated
  86. into other formats.
  87.  
  88.    `graph' can read datasets in both ASCII and binary format, and
  89. datasets in the `table' format produced by the plotting program
  90. `gnuplot'.  It produces a plot with or without axes and labels.  You
  91. may specify labels and ranges for the axes, and the size and position
  92. of the plot on the display.  The labels may contain subscripts and
  93. subscripts, Greek letters, and other special symbols; there is also
  94. support for Cyrillic script (i.e., Russian) and Japanese.  You may
  95. specify the type of plotting symbol used for each dataset, and such
  96. parameters as the style and thickness of the line (if any) used to
  97. connect points in a dataset.  The plotting of filled regions is
  98. supported, as is the drawing of error bars.  `graph' provides full
  99. support for multiplotting.  With a single invocation of `graph', you
  100. may produce a plot consisting of many sub-plots, either side by side or
  101. inset.  Each sub-plot will have its own axes and data.
  102.  
  103.    `graph -T X', `graph -T tek', and raw `graph' have a feature which
  104. most plotting programs do not have.  They can accept input from a pipe,
  105. and plot data points in real time.  For this to occur, the user must
  106. specify ranges for both axes, so that `graph' does not need to wait
  107. until the end of the input before determining them.
  108.  
  109.    The `plot' program is a so-called plot filter.  It can translate GNU
  110. graphics metafiles (produced for example by raw `graph') into the six
  111. supported output formats.  The corresponding commands are `plot -T X',
  112. `plot -T ps', `plot -T fig', `plot -T hpgl', `plot -T tek', and `plot'.
  113. The `plot' program is useful if you wish to produce output in several
  114. different formats while invoking `graph' only once.  It is also useful
  115. if you wish to translate files in the traditional `plot(5)' format
  116. produced by, e.g., the non-GNU versions of `graph' provided with some
  117. operating systems.  GNU metafile format is compatible with the
  118. traditional `plot(5)' format.
  119.  
  120.    The `tek2plot' program can translate from Tektronix format to any of
  121. the abovementioned output formats.  The corresponding commands are
  122. `tek2plot -T X', `tek2plot -T ps', `tek2plot -T fig', `tek2plot -T
  123. hpgl', and `tek2plot'.  `tek2plot' is useful if you have a legacy
  124. application that produces drawings in Tektronix format.
  125.  
  126.    The `plotfont' program is a simple utility that displays a character
  127. map for any font that is available to `graph', `plot', or `tek2plot'.
  128. If the `-T X', `-T ps', or `-T fig' options are used, the 35 standard
  129. Postscript fonts are available, and if the `-T hpgl' option is used,
  130. the 45 standard PCL 5 fonts are available.  A set of 22 Hershey vector
  131. fonts, including Cyrillic fonts and a Japanese font, is always
  132. available.  When producing output for an X Window System display, any
  133. of these programs can use scalable X fonts.
  134.  
  135.    Among the other GNU plotting utilities, `spline' does spline
  136. interpolation of scalar or vector-valued data.  It normally uses either
  137. cubic spline interpolation or exponential splines in tension, but like
  138. `graph' it can function as a real-time filter under some circumstances.
  139. Besides splining datasets, it can construct curves, either open or
  140. closed, through arbitrarily chosen points in d-dimensional space.
  141. `ode' provides the ability to integrate an ordinary differential
  142. equation or a system of ordinary differential equations, when provided
  143. with an explicit expression for each equation.  It supplements the
  144. plotting program `gnuplot', which can plot functions but not integrate
  145. ordinary differential equations.  The final plotting utility, `double',
  146. is a filter for converting, scaling and cutting binary or ASCII data
  147. streams.  It is still under development and is not yet documented.
  148.  
  149.    Distributed along with the plotting utilities is GNU `libplot', the
  150. function library for device-independent two-dimensional vector graphics
  151. on which `graph', `plot', `tek2plot', and `plotfont' are based.
  152. `libplot' can draw graphics on X Window System displays, and perform
  153. smooth, double-buffered animation.  It can also generate graphical
  154. output in any of five additional formats.  This includes (1) output in
  155. Postscript format that may be included in another document, edited with
  156. the `idraw' drawing editor, or sent directly to a printer, (2) output
  157. that may be displayed and edited with the `xfig' drawing editor,
  158. (3) output in HP-GL or HP-GL/2 format that may be sent to a
  159. Hewlett-Packard LaserJet printer or plotter, (4) output that may be
  160. displayed on a Tektronix 4014 terminal or emulator, and (5) output in
  161. the device-independent GNU graphics metafile format.
  162.  
  163.    `libplot' can draw such objects as lines, open and closed polylines,
  164. arcs (both circular and elliptic), circles and ellipses, points, marker
  165. symbols, and text strings.  The filling of objects other than points,
  166. marker symbols, and text strings is supported (fill color, as well as
  167. pen color, can be set arbitrarily).  The support for drawing text
  168. strings is extensive.  The X Window System, Postscript, and `xfig'
  169. drivers support the 35 standard Postscript fonts, and the HP-GL/2
  170. driver supports the 45 standard PCL 5 fonts.  All drivers, including
  171. the Tektronix and metafile drivers, support a set of 22 Hershey vector
  172. fonts.  Text strings may include subscripts and superscripts, and may
  173. include characters chosen from more than one font in a typeface.  Many
  174. non-alphanumeric characters may be included.  The entire collection of
  175. over 1700 `Hershey glyphs' digitized by Allen V. Hershey at the U.S.
  176. Naval Surface Weapons Center, which includes many curious symbols, is
  177. built into `libplot'.  Japanese text strings in the so-called EUC
  178. (Extended Unix Code) format can be also be drawn.  Such strings may
  179. include both syllabic characters (Hiragana and Katakana) and
  180. ideographic characters (Kanji).  A library of over 600 Japanese Kanji
  181. digitized by Dr. Hershey is built into `libplot'.
  182.  
  183.    The drawing editors `idraw' and `xfig' are not distributed along
  184. with the GNU plotting utilities.  However, they are free software, and
  185. you may readily obtain them elsewhere (*note Auxiliary Software::.).
  186.  
  187. 
  188. File: plotutils.info,  Node: graph,  Next: plot,  Prev: Plotutils Intro,  Up: Top
  189.  
  190. The `graph' Application
  191. ***********************
  192.  
  193.    Each invocation of `graph' reads one or more datasets from files
  194. named on the command line or from standard input, and prepares a plot.
  195. There are many command-line options for adjusting the visual appearance
  196. of the plot.  The following sections explain how to use the most
  197. frequently used options, by giving examples.
  198.  
  199. * Menu:
  200.  
  201. * Simple Examples::     Simple examples using graph
  202. * Non-Square Plots::    Changing the aspect ratio of a plot
  203. * Multiple Datasets::   Preparing a plot from more than one dataset
  204. * Multiplotting::       Multiple plots on a single page
  205. * Data Formats::        Reading binary and other data formats
  206. * graph Invocation::    Command-line options
  207.  
  208. 
  209. File: plotutils.info,  Node: Simple Examples,  Next: Non-Square Plots,  Prev: graph,  Up: graph
  210.  
  211. Simple examples using `graph'
  212. =============================
  213.  
  214.    By default, `graph' reads ASCII data from the files specified on the
  215. command line, or from standard input if no files are specified.  The
  216. data are pairs of numbers, interpreted as the x and y coordinates of
  217. data points:
  218.  
  219.      0.0  0.0
  220.      1.0  0.2
  221.      2.0  0.0
  222.      3.0  0.4
  223.      4.0  0.2
  224.      5.0  0.6
  225.  
  226. Data points do not need to be on different lines, nor do the x and y
  227. coordinates of a data point need to be on the same line.  However,
  228. there should be no blank lines in the input if it is to be viewed as
  229. forming a single dataset.
  230.  
  231.    To plot such a dataset with `graph', you could do
  232.  
  233.      graph -T ps ascii_data_file > plot.ps
  234.  
  235. or equivalently
  236.  
  237.      graph -T ps < ascii_data_file > plot.ps
  238.  
  239. This will produce an encapsulated Postscript file `plot.ps', which you
  240. may include in another document, display on a screen, or send directly
  241. to a printer.  (The `--page-size' option, or the `PAGESIZE' environment
  242. variable, specifies the size of the printed page.  The default is
  243. "letter", i.e., 8.5in by 11in, but "a4" or other ISO or ANSI page sizes
  244. can be specified instead.)
  245.  
  246.    You may also do
  247.  
  248.      graph -T fig < ascii_data_file > plot.fig
  249.  
  250. to produce a file `plot.fig' that you may edit with the the `xfig'
  251. drawing editor, or
  252.  
  253.      graph -T hpgl < ascii_data_file > plot.plt
  254.  
  255. to produce a file `plot.plt' in the Hewlett-Packard Graphics Language
  256. (HP-GL/2) that you may send to a Hewlett-Packard LaserJet printer or
  257. plotter.
  258.  
  259.    You may use `graph -T X' to pop up a window on an X Window System
  260. display, and display the plot in it.  For that, you would do
  261.  
  262.      graph -T X < ascii_data_file
  263.  
  264. If you use `graph -T X', no output file will be produced; only a
  265. window.  The window will vanish if you type `q' or click your mouse
  266. in it.
  267.  
  268.    You may also use `graph -T tek', to display a plot on a device that
  269. can emulate a Tektronix 4014 graphics terminal.  `xterm', the X Window
  270. System terminal emulator, can do this.  Within an `xterm' window, you
  271. would do
  272.  
  273.      graph -T tek < ascii_data_file
  274.  
  275. `xterm' normally emulates a VT100 terminal, but when this command is
  276. issued from within it, it will pop up a second window (a `Tektronix
  277. window') and draw the plot in it.  The Japanese terminal emulator
  278. `kterm' should be able to do the same, provided that it is correctly
  279. installed.  Another piece of software that can emulate a Tektronix 4014
  280. terminal is the MS-DOS version of `kermit'.
  281.  
  282.    `graph' may behave differently depending on the environment in which
  283. it is invoked.  We have already mentioned the `PAGESIZE' environment
  284. variable, which affects the operation of `graph -T ps', `graph -T fig',
  285. and `graph -T hpgl'.  The `DISPLAY' and `BITMAPSIZE' environment
  286. variables affect the operation of `graph -T X', and the `TERM'
  287. environment variable affects the operation of `graph -T tek'.  There
  288. are also several environment variables that affect the operation of
  289. `graph -T hpgl'.  For a complete discussion of the effects of the
  290. environment on `graph', see *Note graph Environment::.  The following
  291. remarks apply irrespective of which display type is specified.
  292.  
  293.    By default, successive points in the dataset are joined by solid line
  294. segments, which form a polygonal line or polyline that we call simply a
  295. `line'.  You may choose the style of line (the `linemode') with the
  296. `-m' option:
  297.  
  298.      graph -T ps -m 2 < ascii_data_file > plot.ps
  299.  
  300. Here `-m 2' indicates that linemode #2 should be used.  If the dataset
  301. is rendered in monochrome, which is the default, the line can be drawn
  302. in one of five distinct styles.  Linemodes #1 through #5 signify solid,
  303. dotted, dotdashed, shortdashed, and longdashed; thereafter the sequence
  304. repeats.  If the `-C' option is used, the dataset will be rendered in
  305. color.  For colored datasets, the line can be drawn in one of 25
  306. distinct styles.  Linemodes #1 through #5 signify red, green, blue,
  307. magenta, and cyan; all are solid.  Linemodes #6 through #10 signify the
  308. same five colors, but dotted rather than solid.  Linemodes #11 through
  309. #16 signify the same five colors, but dotdashed, and so forth.  After
  310. linemode #25, the sequence repeats.  Linemode #0, irrespective of
  311. whether the rendering is in monochrome or color, means that the line is
  312. not drawn.
  313.  
  314.    If you wish to *fill* the polygon bounded by the line (i.e., shade
  315. it, or fill it with a solid color), you may use the `-q' option.  For
  316. example,
  317.  
  318.      echo .1 .1 .1 .9 .9 .9 .9 .1 .1 .1 | graph -T ps -C -m 1 -q 0.3 > plot.ps
  319.  
  320. will plot a square region with vertices (0.1,0.1), (0.1,0.9), (0.9,0.9),
  321. and (0.9,0.1).  The repetition of the first vertex (0.1,0.1) at the end
  322. of the sequence of vertices ensures that the square will be closed: all
  323. four segments of its boundary will be drawn.  The square will be drawn
  324. in red (since the colored version of linemode #1 is requested).  The
  325. interior of the square will be filled with red to an intensity of 30%,
  326. as the `-q 0.3' option indicates.  If the intensity were zero, the
  327. region would be filled with white, and if it were 1.0, the region would
  328. be filled with solid color.  If the intensity were negative, the region
  329. would be unfilled, or transparent (the default).
  330.  
  331.    You may choose the width of the line, whether it is filled or not, by
  332. using the `-W' option.  For example, `-W 0.01' means that the line
  333. should have a width equal to 0.01 times the width of the display.
  334. Also, you may put symbols at each data point along the line by doing,
  335. for example,
  336.  
  337.      graph -T ps -S 3 0.1 < ascii_data_file > plot.ps
  338.  
  339. where the first argument 3 indicates which symbol to plot.  The optional
  340. second argument 0.1 specifies the symbol size as a fraction of the size
  341. of the `plotting box': the square within which the plot is drawn.
  342. Symbol #1 is a dot, symbol #2 is a plus sign, symbol #3 is an asterisk,
  343. symbol #4 is a circle, symbol #5 is a cross, and so forth.  (*Note
  344. Marker Symbols::.)  Symbols 1 through 31 are the same for all display
  345. types, and the color of a symbol will be the same as the color of the
  346. line it is plotted along.
  347.  
  348.    Actually, you would probably not want to plot symbols at each point
  349. in the dataset unless you turn off the line joining the points.  For
  350. this purpose, the `negative linemode' concept is useful.  A line whose
  351. linemode is negative is not visible; however, any symbols plotted along
  352. it will have the color associated with the corresponding positive
  353. linemode.  So, for example,
  354.  
  355.      graph -T ps -C -m -3 -S 4 < ascii_data_file > plot.ps
  356.  
  357. will plot a blue circle at each data point.  The circles will not be
  358. joined by line segments.  By adding the optional second argument to the
  359. `-S' option, you may adjust the size of the circles.
  360.  
  361.    `graph' will automatically generate abscissa (i.e., x) values for
  362. you if you use the `-a' option.  If this option is used, no abscissa
  363. values should be given in the data file.  The data points will be taken
  364. to be regularly spaced along the abscissa.  The two arguments following
  365. `-a' on the command line will be taken as the sampling interval and the
  366. abscissa value of the first data point.  If they are absent, they
  367. default to 1.0 and 0.0 respectively.  For example, the command
  368.  
  369.      echo 0 1 0 | graph -T ps -a > plot.ps
  370.  
  371. produces exactly the same plot  as
  372.  
  373.      echo 0 0 1 1 2 0 | graph -T ps > plot.ps
  374.  
  375.    `graph' will plot data with error bars, if the `-I e' option is
  376. specified.  If it is, the dataset should consist of triples (x,y,error)
  377. rather than pairs (x,y).  A vertical error bar of the appropriate
  378. length will be plotted at each data point.  You may plot a symbol at
  379. each data point, along with the error bar, by using the `-S' option in
  380. the usual way.  The symbol will be the same for each point in the
  381. dataset.  You may use the `-a' option in conjunction with `-I e', if
  382. you wish.  If you do, the dataset should contain no abscissa (i.e., x)
  383. values.
  384.  
  385.    By default the limits on the x and y axes, and the spacing between
  386. the labeled ticks on each axis, are computed automatically.  You may
  387. wish to set them manually.  You may accomplish this with the `-x' and
  388. `-y' options.
  389.  
  390.      echo 0 0 1 1 2 0 | graph -T ps -x -1 3 -y -1 2 > plot.ps
  391.  
  392. will produce a plot in which the x axis extends from -1 to 3, and the y
  393. axis from -1 to 2.  By default, `graph' tries to place about six
  394. numbered ticks on each axis.  By including an optional third argument
  395. to either `-x' or `-y', you may manually set the spacing of these
  396. ticks, also.  For example, using `-y -1 2 1' rather than `-y -1 2' will
  397. produce a y axis with labeled ticks at -1, 0, 1, and 2, rather than at
  398. the locations that `graph' would choose by default.  In general, if a
  399. third argument is present then labeled ticks will be placed at each of
  400. its integer multiples.
  401.  
  402.    To make an axis logarithmic, you may use the `-l' option.  For
  403. example,
  404.  
  405.      echo 1 1 2 3 3 1 | graph -T ps -l x > plot.ps
  406.  
  407. will produce a plot in which the x axis is logarithmic, but the y axis
  408. is linear.  To make both axes logarithmic, you would use `-l x -l y'.
  409. By default, the upper and lower limits on a logarithmic axis are powers
  410. of ten, and the tick marks at these powers of ten, and no other tick
  411. marks, are labeled.  If you need more labeled ticks on a logarithmic
  412. axis, you should specify a tick spacing manually.  For example, `-l x
  413. -x 1 9 2' will produce a plot in which the x axis is logarithmic and
  414. extends from 1 to 9.  Labeled ticks will be located at each integer
  415. multiple of 2, i.e., at 2, 4, 6, and 8.
  416.  
  417.    You may label the x and y axes with the `-X' and `-Y' options,
  418. respectively.  For example,
  419.  
  420.      echo 1 1 2 3 3 1 | graph -T ps -l x -X "A Logarithmic Axis" > plot.ps
  421.  
  422. will label the log axis in the preceding example.  By default the label
  423. for the y axis (if any) will be rotated 90 degrees, unless you use the
  424. `--toggle-rotate-y-label' option.  You may specify a `top label', or
  425. title for the plot, by using the `-L' option.  Doing, for example,
  426.  
  427.      echo 1 1 2 3 3 1 | graph -T ps -l x -L "A Simple Example" > plot.ps
  428.  
  429. will produce a plot with a title on top.
  430.  
  431.    The size of the x axis and y axis labels is specified with the `-f'
  432. option, and the size of the title is specified with the
  433. `--title-font-size' option.  For example,
  434.  
  435.      echo 1 1 2 3 3 1 | graph -T ps -X "Abscissa" -f 0.1 > plot.ps
  436.  
  437. will produce a plot in which the font size of the x axis label, and
  438. each of the numerical tick labels, is very large (0.1 times the size of
  439. the plotting box, i.e., the square within which the plot is drawn).
  440.  
  441.    The font in which the labels specified with the `-X', `-Y', and `-L'
  442. options are drawn can be specified with the `-F' option.  For example,
  443. `-F Times-Roman' will make the labels appear in Times-Roman instead of
  444. the default font (which is Helvetica, unless `-T hpgl' or `-T tek' is
  445. specified).  Font names are case-insensitive, so `-F times-roman' will
  446. work equally well.  The available fonts include 35 Postscript fonts
  447. (for all variants of `graph' other than `graph -T hpgl' and `graph -T
  448. tek'), 45 PCL 5 fonts (for `graph -T hpgl'), and 22 Hershey vector
  449. fonts.  The Hershey fonts include HersheyCyrillic, for Russian, and
  450. HersheyEUC, for Japanese.  For a discussion of the available fonts, see
  451. *Note Text Fonts::.  The `plotfont' utility will produce a character
  452. map of any available font.  *Note plotfont::.
  453.  
  454.    The format of the labels drawn with the `-X', `-Y', and `-L' options
  455. may be quite intricate.  Subscripts, superscripts, square roots, and
  456. switching fonts within a typeface are all allowed.  The above examples
  457. do not illustrate this, but for details, see *Note Text String Format::.
  458.  
  459.    Each of the preceding examples produced a plot containing the default
  460. sort of grid (a square box, with ticks and labels drawn along its lower
  461. edge and its left edge).  There are actually several sorts of grid you
  462. may request.  The `-g 0', `-g 1', `-g 2', and `-g 3' options yield
  463. successively fancier grids.  What they yield, respectively, is no grid
  464. at all, a pair of axes with ticks and labels, a square box with ticks
  465. and labels, and a square box with ticks, labels, and grid lines.  As
  466. you can see, `-g 2' is the default.  There is also a `-g 4' option,
  467. which yields a slightly different sort of grid: a pair of axes that
  468. cross at the origin.  This last sort of grid is useful if the x or y
  469. coordinates of the data points you are plotting are both positive and
  470. negative.
  471.  
  472. 
  473. File: plotutils.info,  Node: Non-Square Plots,  Next: Multiple Datasets,  Prev: Simple Examples,  Up: graph
  474.  
  475. Non-square and displaced plots
  476. ==============================
  477.  
  478.    To alter the linear dimensions of a plot, and also to position it in
  479. a different part of your display, you could do something like
  480.  
  481.      graph -T ps -h .3 -w .6 -r .1 -u .1 < ascii_data_file > plot.ps
  482.  
  483. Here the `-h' and `-w' options specify the height and width of the
  484. plotting box, and the `-r' and `-u' options indicate how far up and to
  485. the right the lower left corner of the plotting box should be
  486. positioned.  All dimensions are expressed as fractions of the size of
  487. the graphics display, which by convention is a square.  By default, the
  488. height and width of the plotting box equal 0.6, and the `upward shift'
  489. and the `rightward shift' equal 0.2.  So the above example will produce
  490. a plot that is half as tall as usual.  Compared to its usual position,
  491. the plot will be shifted slightly downward and to the left.
  492.  
  493.    The `graphics display', within which the plotting box is located, is
  494. an abstraction.  For `graph -T X', it is a square window on an
  495. X display, the size of which can be set by using the `--bitmap-size'
  496. option, or by setting the `BITMAPSIZE' environment variable.  For
  497. `graph -T tek', it is a square region occupying the central part of a
  498. Tektronix display.  (Tektronix displays are 4/3 times as wide as they
  499. are high.)  For `graph -T ps', by default it is a square region
  500. centered on an 8.5in by 11in page (US letter size), occupying the full
  501. width of the page with allowance being made for margins.  For `graph -T
  502. fig', by default it is a square region of the same size, positioned in
  503. the upper left corner of an `xfig' display.  For `graph -T hpgl',
  504. by default it is a square region of the same size, with position and
  505. orientation on the page being controlled by environment variables.  The
  506. page size used by `graph -T ps', `graph -T fig', and `graph -T hpgl'
  507. can be set by using the `--page-size' option, or by setting the
  508. environment variable `PAGESIZE'.  For example, setting `PAGESIZE' to
  509. "a4" would position the graphics display appropriately on an A4-size
  510. page (21cm by 29.7cm).
  511.  
  512.    Changing the width of the plotting box may have unforeseen
  513. consequences.  A number of command-line options specify sizes or
  514. dimensions as fractions of the width of the plotting box.  For example,
  515. `-S 3 .01' specifies that the plotting symbols for the following dataset
  516. should be of type #3, and should have a fractional size equal to 0.01.
  517. If the `-w' option is employed to widen or narrow the plot, such
  518. dimensions or sizes will scale in tandem.  That is presumably the right
  519. thing to do, but may be slightly disconcerting.
  520.  
  521. 
  522. File: plotutils.info,  Node: Multiple Datasets,  Next: Multiplotting,  Prev: Non-Square Plots,  Up: graph
  523.  
  524. Preparing a plot from more than one dataset
  525. ===========================================
  526.  
  527.    It is frequently the case that several datasets need to be displayed
  528. on the same plot.  If so, you may wish to distinguish the points in
  529. different datasets by joining them by lines of different types, or by
  530. using plotting symbols of different types.
  531.  
  532.    A more complicated example would be the following.  You may have a
  533. file containing a dataset that is the result of experimental
  534. observations, and a file containing closely spaced points that trace
  535. out a theoretical curve.  The second file is a dataset in its own
  536. right.  You would presumably plot it with line segments joining
  537. successive points, so as to trace out the theoretical curve.  But the
  538. first dataset, resulting from experiment, would be plotted without such
  539. line segments.  In fact, a plotting symbol would be plotted at each of
  540. its points.
  541.  
  542.    These examples, and others like them, led us to define a set of seven
  543. *attributes* which define the way in which a dataset should be plotted.
  544. These attributes, which can be set by command-line options, are the
  545. following.
  546.  
  547.   1. color/monochrome
  548.  
  549.   2. linemode
  550.  
  551.   3. linewidth
  552.  
  553.   4. symbol type
  554.  
  555.   5. symbol size
  556.  
  557.   6. symbol font name
  558.  
  559.   7. fill fraction
  560.  
  561. Color/monochrome (a choice of one or the other) is the simplest.  This
  562. choice is toggled with the `-C' option.  The `linemode' (i.e., line
  563. style) specifies how the line segments joining successive points should
  564. be drawn; it is specified with the `-m' option.  Linemode #0 means no
  565. linemode at all, for example.  `Linewidth' is self-explanatory; it is
  566. specified with the `-W' option. `Symbol type' and `symbol size', which
  567. are specified with the `-S' option, specify the symbol plotted at each
  568. point of the dataset.  `Symbol font name' refers to the font from which
  569. plotting symbols #32 and above, which are taken to be characters rather
  570. than geometric symbols, are selected.  It is set with the
  571. `--symbol-font-name' option, and is relevant only if `-S' is used to
  572. request such special plotting symbols. Finally, the polygonal line
  573. joining the points in a dataset may be *filled*, to create a filled or
  574. shaded polygon.  The `fill fraction' is set with the `-q' option.
  575. A negative fill fraction means no fill, or transparent; zero means
  576. white, and 1.0 means solid, or fully colored.
  577.  
  578.    The preceding seven attributes refer to the way in which datasets are
  579. plotted.  Datasets may also differ from one another in the way in which
  580. they are read from files.  The dataset(s) in a file may or may not
  581. contain error bars, for example.  If a file contains data with error
  582. bars, the `-I e' option should occur on the command line before the
  583. file name.  (The `-I' option specifies the input format for the
  584. following files.)
  585.  
  586.    The following illustrates how datasets in three different input files
  587. could be plotted simultaneously.
  588.  
  589.      graph -T ps -m 0 -S 3 file_1 -C -m 3 file_2 -C -W 0.02 file_3 > output.ps
  590.  
  591. The dataset in `file_1' will be plotted in linemode #0, so successive
  592. points will not be joined by lines.  But symbol #3 (an asterisk) will
  593. be plotted at each point.  The dataset in `file_2' will be plotted in
  594. color, and linemode #3 will be used.  In color plotting, linemode #3 is
  595. interpreted as a solid blue line.  The second `-C' on the command line
  596. turns off color for `file_3'.  The points in the third dataset will be
  597. joined by a black line of width 0.02, as a fraction of the width of the
  598. graphics display.
  599.  
  600.    The above command line could be made even more complicated by
  601. specifying additional options (e.g., `-q' or `-I') before each file.
  602. In fact the command line could also include such standard options as
  603. `-x' or `-y', which specify the range of each axis.  Such options,
  604. which refer to the plot as a whole rather than to individual datasets,
  605. should appear before the first file name.  For example, you could do
  606.  
  607.      graph -T ps -x 0 1 0.5 -m 0 -S 3 file_1 -C -m 3 file_2 > output.ps
  608.  
  609. Note that it is possible to include the special file name `-', which
  610. refers to standard input, on the command line.  So you may produce a
  611. plot in part from files, and in part from input that is piped to
  612. `graph' from another program.
  613.  
  614.    Each input file may include more than one dataset.  If so, the
  615. command line options preceding a file on the command line will take
  616. effect for all datasets in that file.  There are two exceptions to
  617. this.  By default, the linemode is incremented (`bumped') from one
  618. dataset to the next.  This feature is usually quite convenient.  For
  619. example, if you do
  620.  
  621.      graph -T ps -m 3 file_1 > output.ps
  622.  
  623. the first dataset in `file_1' will appear in linemode #3, the second in
  624. linemode #4, etc.  In fact if you do
  625.  
  626.      graph -T ps file_1 file_2 ... > output.ps
  627.  
  628. without specifying linemode explicitly, the successive datasets read
  629. from the files on the command line will appear in linemode #1, linemode
  630. #2, ....  If you do not like this feature, you may turn it off, or in
  631. general toggle it, by using the `-B' option.
  632.  
  633.    You may also control manually the linemode and symbol type used for
  634. the datasets within any file.  You would do this by including
  635. directives in the file itself, rather than on the command line.  For
  636. example, if the line
  637.  
  638.      #m=-5,S=10
  639.  
  640. appeared in an ASCII-format input file, it would be interpreted as a
  641. directive to switch to linemode #-5 and symbol type #10 for the
  642. following dataset.  Future releases of `graph' may provide the ability
  643. to set each of the seven dataset attributes in this way.
  644.  
  645. 
  646. File: plotutils.info,  Node: Multiplotting,  Next: Data Formats,  Prev: Multiple Datasets,  Up: graph
  647.  
  648. Multiplotting: placing multiple plots on a single page
  649. ======================================================
  650.  
  651.    It is occasionally useful to display several plots at once on a
  652. single page, or on a single graphics display.  We call such a composite
  653. plot a *multiplot*.  One common sort of multiplot is a small plot inset
  654. into a larger one.  Another sort is two or more plots side by side.
  655.  
  656.    `graph' can draw multiplots consisting of an arbitrarily large
  657. number of sub-plots.  When multiplotting, `graph' draws each sub-plot
  658. in its own `virtual display'.  When an ordinary plot is drawn, the
  659. virtual display is the same as the physical display.  But when a
  660. multiplot is drawn, the virtual display may be any smaller square
  661. region.  The following example illustrates the idea.
  662.  
  663.      graph -T ps data_file_1 --reposition .35 .35 .3 data_file_2
  664.  
  665. Here `data_file_1' is plotted in the usual way.  The `--reposition'
  666. option specifies that when `data_file_2' is plotted, it will be drawn
  667. within a virtual display.  For the purposes of the `--reposition'
  668. option, the physical display is a square with lower left corner
  669. (0.0,0.0) and upper right corner (1.0,1.0).  In those coordinates, the
  670. virtual display will be a square of size 0.3 with lower left corner
  671. (0.35,0.35).  So the second sub-plot will be inset into the first.
  672.  
  673.    Just as the `-w', `-h', `-r', and `-u' options may be used to set
  674. the size and position of a plotting box within the physical display, so
  675. they may be used to set the size and position of a plotting box within
  676. a virtual display.  For example,
  677.  
  678.      graph -T ps data_file_1 --reposition .35 .35 .3 -w .4 -r .3 data_file_2
  679.  
  680. will yield a multiplot in which the second sub-plot is significantly
  681. different.  Its plotting box will have a width only 0.4 times the width
  682. of the virtual display.  However, the plotting box will be centered
  683. within the virtual display, since the distance between the left edge of
  684. the plotting box and the left edge of the virtual display will be 0.3
  685. times the width of the virtual display.
  686.  
  687.    By convention, before each sub-plot of a multiplot other than the
  688. first is drawn, a `blankout region' surrounding its plotting box is
  689. erased.  (That is, it is filled with white.)  This erasure prevents the
  690. sub-plots from overlapping and producing a messy result.  By default,
  691. the blankout region is a rectangular region 30% larger in each dimension
  692. than the plotting box for the sub-plot.  This is appropriate if the
  693. sub-plot is a small one that is inset into the first sub-plot.  It may
  694. not be appropriate, however, if you are preparing a multiplot in which
  695. several sub-plots appear side by side.  You may use the `--blankout'
  696. option to adjust this parameter.  For example, specifying `--blankout
  697. 1.0' will make the blankout region for a sub-plot coincide with its
  698. plotting box.  Specifying `--blankout 0.0' will prevent any blanking
  699. out from occurring.  The blankout parameter may differ from sub-plot to
  700. sub-plot.
  701.  
  702.    It should be emphasized that every sub-plot in a multiplot is a plot
  703. in its own right.  All the usual options (`-m', `-S', `-x', `-y', etc.)
  704. can be applied to each sub-plot separately.  The options for a sub-plot
  705. should occur on the `graph' command line immediately after the
  706. `--reposition' option that applies to it.  Each sub-plot may be
  707. prepared from more than a single dataset, also.  The names of the data
  708. files for each subplot should occur on the command line before the
  709. following `--reposition' option, if any.
  710.  
  711. 
  712. File: plotutils.info,  Node: Data Formats,  Next: graph Invocation,  Prev: Multiplotting,  Up: graph
  713.  
  714. Reading binary and other data formats
  715. =====================================
  716.  
  717.    By default, `graph' reads datasets in ASCII format.  But it can also
  718. read datasets in any of three binary formats (single precision floating
  719. point, double precision floating point, and integer).  These three
  720. input formats are specified by the `-I d', `-I f', and `-I i' options,
  721. respectively.
  722.  
  723.    There are two advantages to using binary data: 1) `graph' runs
  724. significantly faster because the computational overhead for converting
  725. data from ASCII to binary is eliminated, and 2) the input files may be
  726. significantly smaller.  If you have very large datasets, using binary
  727. format may reduce storage and runtime costs.
  728.  
  729.    For example, you may create a single precision binary dataset as
  730. output from a C language program:
  731.  
  732.      #include <stdio.h>
  733.      void write_point (float x, float y)
  734.      {
  735.        fwrite(&x, sizeof (float), 1, stdout);
  736.        fwrite(&y, sizeof (float), 1, stdout);
  737.      }
  738.  
  739. You may plot data written this way by doing:
  740.  
  741.      graph -T ps -I f < binary_data_file > plot.ps
  742.  
  743. The inclusion of multiple datasets within a single binary file is
  744. supported.  If a binary file contains more than a single dataset,
  745. successive datasets should be separated by a single occurrence of the
  746. the largest possible number.  For single precision datasets this is the
  747. quantity `FLT_MAX', for double precision datasets it is the quantity
  748. `DBL_MAX', and for integer datasets it is the quantity `INT_MAX'.  On
  749. most machines `FLT_MAX' is approximately 3.4x10^38, `DBL_MAX' is
  750. approximately 1.8x10^308, and `INT_MAX' is 2^32-1.
  751.  
  752.    If you are reading datasets from more than one file, it is not
  753. required that the files be in the same format.  For example,
  754.  
  755.      graph -T ps -I f binary_data_file -I a ascii_data_file > plot.ps
  756.  
  757. will read `binary_data_file' in `f' (binary single precision) format,
  758. and `ascii_data_file' in `a' (normal ASCII) format.
  759.  
  760.    There is currently no support for reading and plotting binary data
  761. with error bars.  If you have data with error bars, you should supply
  762. the data to `graph' in ASCII, and use the `-I e' option.
  763.  
  764.    `graph' can also read data files in the ASCII `table' format
  765. produced by the `gnuplot' plotting program.  For this, you should use
  766. the `-I g' option.  Such a data file may consist of more than one
  767. dataset.
  768.  
  769.    To sum up: there are six supported data formats, `a' (normal ASCII),
  770. `e' (ASCII with error bars), `g' (the ASCII `table' format produced by
  771. `gnuplot'), `f' (binary single precision), `d' (binary double
  772. precision), and `i' (binary integer).  Input files may be in any of
  773. these six formats.
  774.  
  775. 
  776. File: plotutils.info,  Node: graph Invocation,  Prev: Data Formats,  Up: graph
  777.  
  778. `graph' command-line options
  779. ============================
  780.  
  781.    The `graph' program reads one or more datasets from files named on
  782. the command line or from standard input, and prepares a plot.  The
  783. display type or output format is specified with the `-T' option.  There
  784. are many command-line options for adjusting the visual appearance of
  785. the plot.
  786.  
  787.    By default, `graph' reads ASCII data from the files specified on the
  788. command line.  The data are pairs of numbers, interpreted as the x
  789. and y coordinates of data points.  If no file names are specified, or
  790. the file name `-' is specified, the standard input is read.
  791.  
  792.    The relative order of file names and command-line options is
  793. important.  Only the options that precede a file name on the command
  794. line take effect for that file.
  795.  
  796.    The following sections list the possible command-line options.  Each
  797. option that takes an argument is followed, in parentheses, by the type
  798. and default value of the argument.  There are five sorts of option.
  799.  
  800.    The behavior of `graph' is also affected by a number of environment
  801. variables, so there is a section discussing them as well.
  802.  
  803. * Menu:
  804.  
  805. * Plot Options::        Options affecting an entire plot
  806. * Dataset Options::     Options affecting the reading and plotting of datasets
  807. * Multiplot Options::   Options for drawing several plots at once
  808. * Raw graph Options::   Options relevant only to raw graph
  809. * Info Options::        Options requesting information (e.g., --help)
  810. * graph Environment::   Environment variables
  811.  
  812. 
  813. File: plotutils.info,  Node: Plot Options,  Next: Dataset Options,  Prev: graph Invocation,  Up: graph Invocation
  814.  
  815. Plot options
  816. ------------
  817.  
  818.    The following options affect an entire plot.  They should normally
  819. occur at most once, and should appear on the command line before the
  820. first file name.  If a multiplot is being drawn, they may (with the
  821. exception of the `-T' option) occur more than once.  If so, the second
  822. and later occurrences should be placed on the command line immediately
  823. after each `--reposition X Y' option.
  824.  
  825. `-T TYPE'
  826. `--display-type TYPE'
  827.      (String, default "meta".)  Select a display type or output format
  828.      of TYPE, which may be one of the strings "X", "ps", "fig", "hpgl",
  829.      "tek", and "meta".  These refer respectively to the
  830.      X Window System, `idraw'-editable Postscript, the format used by
  831.      the `xfig' drawing editor, the Hewlett-Packard Graphics Language,
  832.      Tektronix format, and device-independent GNU metafile format.
  833.  
  834. `-f FONT_SIZE'
  835. `--font-size FONT_SIZE'
  836.      (Float, default 0.0525.)  Set the size of the font used for the
  837.      axis and tick labels, as a fraction of the size of the `plotting
  838.      box' (the box that frames the plot), to be FONT_SIZE.
  839.  
  840. `-F FONT_NAME'
  841. `--font-name FONT_NAME'
  842.      (String, default "Helvetica" except for `graph -T hpgl' and `graph
  843.      -T tek', for which "HersheySerif" is the default.)  Set the font
  844.      used for the axis and tick labels, and for the plot title
  845.      (if any), to be FONT_NAME.  The choice of font for the plot title
  846.      may be overridden with the `--title-font-name' option (see below).
  847.      Font names are case-insensitive.  If the specified font is not
  848.      available, the default font will be used.  Which fonts are
  849.      available depends on which `-T' option is used.  For a list of all
  850.      fonts, see *Note Text Fonts::.  The `plotfont' utility will
  851.      produce a character map of any available font.  *Note plotfont::.
  852.  
  853. `-g GRID_STYLE'
  854. `--grid-style GRID_STYLE'
  855.      (Integer in the range 0...4, default 2.)  Set the grid style for
  856.      the plot to be GRID_STYLE.  Grid styles 0 through 3 are
  857.      progressively more fancy, but style 4 is a somewhat different
  858.      style.
  859.  
  860.        0. no axes, tick marks or labels.
  861.  
  862.        1. a pair of axes, with tick marks and labels.
  863.  
  864.        2. box around plot, with tick marks and labels.
  865.  
  866.        3. box around plot, with tick marks and labels; also grid lines.
  867.  
  868.        4. axes intersect at the origin, with tick marks and labels.
  869.  
  870. `-h HEIGHT'
  871. `--height-of-plot HEIGHT'
  872.      (Float, default 0.6.)  Set the fractional height of the plot with
  873.      respect to the height of the display (or virtual display, in the
  874.      case of a multiplot) to be HEIGHT.  A value of 1.0 will produce a
  875.      plotting box that fills the available area.  Note that tick marks
  876.      and labels are outside the plotting box, so that values less than
  877.      1.0 are generally used.
  878.  
  879. `-K CLIP_MODE'
  880. `--clip-mode CLIP_MODE'
  881.      (Integer, default 1.) Set the clip mode for the plot to CLIP_MODE.
  882.      The clip mode is relevant only if data points are being joined by a
  883.      line, and the line is not being filled to create a filled region
  884.      (since filled regions are clipped in a fixed way).  There are
  885.      three clip modes: 0, 1, and 2.  Clip mode 0 means that a line
  886.      segment joining two data points will be plotted only if neither
  887.      point is outside the plotting box.  Clip mode 1 means that it will
  888.      be plotted if no more than one of the two points is outside, and
  889.      clip mode 2 means that it will be plotted even if both are
  890.      outside.  In all cases the line segment will be clipped to the
  891.      plotting box.
  892.  
  893. `-L TOP_LABEL'
  894. `--top-label TOP_LABEL'
  895.      (String, default empty.)  Place the text string TOP_LABEL above
  896.      the plot, as a plot title.  The string may include escape sequences
  897.      (*note Text String Format::.).  The `--title-font-size' option may
  898.      be used to specify the size of the font.  The font is normally the
  899.      same as the font used for labelling axes and tick labels, as
  900.      selected by the `-F' option.  But this can be overridden with the
  901.      `--title-font-name' option.
  902.  
  903. `-l X|Y'
  904. `--toggle-log-axis X|Y'
  905.      Set the specified axis to be a log axis rather than a linear axis,
  906.      or vice versa.  By default, both axes are linear axes.
  907.  
  908. `-N X|Y'
  909. `--toggle-no-ticks X|Y'
  910.      Toggle the presence of ticks and tick labels on the specified axis.
  911.      This applies to the grid styles that normally include ticks and
  912.      tick labels, i.e., grid styles 1, 2, 3, and 4.
  913.  
  914. `-R X|Y'
  915. `--toggle-round-to-next-tick X|Y'
  916.      Toggle the rounding of the limits of the specified axis, so that
  917.      they are integer multiples of the spacing between labeled tick
  918.      marks.  By default this does not take place if the user uses the
  919.      `-x' or `-y' options to set axis limits explicitly.
  920.  
  921. `-r RIGHT'
  922. `--right-shift RIGHT'
  923.      (Float, default 0.2.)  Move the plot to the right by a fractional
  924.      amount RIGHT with respect to the width of the display (or virtual
  925.      display, in the case of a multiplot).  This produces a margin on
  926.      the left side of the plotting box.  A value of 0.5 will produce a
  927.      margin half the width of the available area.  Note that the tick
  928.      marks and labels are drawn in the margin.
  929.  
  930. `-s'
  931. `--save-screen'
  932.      Save the screen.  This option requests that `graph' not erase the
  933.      display device before it begins to plot.  This is relevant only to
  934.      `graph -T tek'.  It may be employed to perform a crude sort of
  935.      multiplotting, since Tektronix displays and emulators are
  936.      persistent, in the sense that previously drawn graphics remain
  937.      visible.
  938.  
  939. `-T TICK_SIZE'
  940. `--tick-size TICK_SIZE'
  941.      (Float, default .02.) Set the fractional size of the tick marks on
  942.      each axis to be TICK_SIZE.  A value of 1.0 produces tick marks on
  943.      the x axis whose length is equal to the width of the plotting box.
  944.      A negative TICK_SIZE will yield tick marks that extend outside
  945.      the box, rather than inside.
  946.  
  947. `-t'
  948. `--toggle-transpose-axes'
  949.      Transpose the abscissa and ordinate.  This causes the axes to be
  950.      interchanged, and the options that apply to each axis to be
  951.      applied to the opposite axis.  That is, data points are read in as
  952.      (y, x) pairs, and such options as `-x' and `-X' apply to the
  953.      y axis rather than the x axis.  If the `-I e' option is in force,
  954.      so that the data points are read with error bars, the orientation
  955.      of the error bars will be switched between vertical and horizontal.
  956.  
  957. `-u UP'
  958. `--upward-shift UP'
  959.      (Float, default 0.2.)  Move the plot up by a fractional amount UP
  960.      with respect to the height of the display (or virtual display, in
  961.      the case of a multiplot).  This produces a margin below the
  962.      plotting box.  A value of 0.5 will produce a margin half the
  963.      height of the available area.  Note that the tick marks and labels
  964.      are drawn in the margin.
  965.  
  966. `-w WIDTH'
  967. `--width-of-plot WIDTH'
  968.      (Float, default 0.6.) Set the fractional width of the plot with
  969.      respect to the width of the display (or virtual display, in the
  970.      case of a multiplot) to be WIDTH.  A value of 1.0 will produce a
  971.      plotting box that fills the available area.  Note that the tick
  972.      marks and labels are outside the plotting box, so values less than
  973.      1.0 are generally used.
  974.  
  975. `-x [LOWER_LIMIT [UPPER_LIMIT [SPACING]]]'
  976. `--x-limits [LOWER_LIMIT [UPPER_LIMIT [SPACING]]]'
  977.      (Floats.) The arguments LOWER_LIMIT and UPPER_LIMIT specify the
  978.      limits of the x axis, and the optional argument SPACING specifies
  979.      the spacing of labeled ticks along the axis.  If any of the three
  980.      arguments is missing, it is computed from the data.  The arguments
  981.      LOWER_LIMIT and UPPER_LIMIT must be present if `graph' is to act
  982.      as a real-time filter.
  983.  
  984. `-y [LOWER_LIMIT [UPPER_LIMIT [SPACING]]]'
  985. `--y-limits [LOWER_LIMIT [UPPER_LIMIT [SPACING]]]'
  986.      (Floats.)  The arguments specify the limits of the y axis, and the
  987.      spacing of labeled ticks along it, as for the x axis (see above).
  988.      The arguments LOWER_LIMIT and UPPER_LIMIT must be present if
  989.      `graph' is to act as a real-time filter.
  990.  
  991. `-X X_LABEL'
  992. `--x-title X_LABEL'
  993.      (String, default empty.)  Set the label for the x axis to be the
  994.      text string X_LABEL.  The string may include escape sequences
  995.      (*note Text String Format::.).  The `-F' and `-f' options may be
  996.      used to specify the name of the font and the size of the font.
  997.  
  998. `-Y Y_LABEL'
  999. `--y-title Y_LABEL'
  1000.      (String, default empty.) Set the label for the y axis to be the
  1001.      text string Y_LABEL.  The string may include escape sequences
  1002.      (*note Text String Format::.).  The label will be rotated by 90
  1003.      degrees so that it is parallel to the axis, unless the
  1004.      `--toggle-rotate-y-label' option is used.  Some old X Window System
  1005.      displays do not support rotated labels, and require the
  1006.      `--toggle-rotate-y-label' option.  The `-F' and `-f' options can
  1007.      be used to specify the name of the font and the size of the font.
  1008.  
  1009. `--bg-color NAME'
  1010.      (String, default "white".)  Set the color used for the plot
  1011.      background to be NAME.  This is currently relevant only to `graph
  1012.      -T X'.  An unrecognized name sets the color to the default.  For
  1013.      information on what names are recognized, see *Note Color Names::.
  1014.      The environment variable `BG_COLOR' can equally well be used to
  1015.      specify the background color.
  1016.  
  1017. `--bitmap-size BITMAP_SIZE'
  1018.      (String, default "570x570".)  Set the size of the graphics display
  1019.      in which the plot will be drawn, in terms of pixels, to be
  1020.      BITMAP_SIZE.  This is relevant only to `graph -T X', for which the
  1021.      graphics display is an X window.  If you choose a rectangular
  1022.      (non-square) window size, the fonts in the plot will be scaled
  1023.      anisotropically, i.e., by different factors in the horizontal and
  1024.      vertical direction.  This requires an X11R6 display.  Any font that
  1025.      cannot be scaled in this way will be replaced by a default scalable
  1026.      font, such as the Hershey vector font "HersheySerif".
  1027.  
  1028.      The environment variable `BITMAPSIZE' can equally well be used to
  1029.      specify the window size.  For backward compatibility, the
  1030.      X resource `Xplot.geometry', which can be set by the user, may be
  1031.      used instead.
  1032.  
  1033. `--frame-color NAME'
  1034.      (String, default "black".)  Set the color used for drawing the plot
  1035.      frame, and for drawing monochrome datasets (if any) to be NAME.
  1036.      An unrecognized name sets the color to the default.  For
  1037.      information on what names are recognized, see *Note Color Names::.
  1038.  
  1039. `--frame-line-width FRAME_LINE_WIDTH'
  1040.      (Float, default -1.0.)  Set the width of lines in the plot frame,
  1041.      as a fraction of the width of the display, to FRAME_LINE_WIDTH.
  1042.      A negative value means that the default value for the line width
  1043.      provided by the `libplot' graphics library should be used.  This
  1044.      value is device-dependent.  The interpretation of zero line width
  1045.      is also device-dependent (on some devices, a zero-width line is the
  1046.      thinnest line that can be drawn; on others, a zero-width line is
  1047.      invisible).
  1048.  
  1049.      `graph -T tek' does not support drawing lines with other than a
  1050.      default width, and `graph -T hpgl' does not support doing so if
  1051.      the environment variable `HPGL_VERSION' is set to a value less
  1052.      than "2" (the default).
  1053.  
  1054. `--max-line-length MAX_LINE_LENGTH'
  1055.      (Integer, default 500.) Set the maximum number of points that a
  1056.      polygonal line drawn through any dataset may contain, before it is
  1057.      flushed to the display device, to equal MAX_LINE_LENGTH.  If this
  1058.      flushing occurs, the polygonal line will be split into two or more
  1059.      sub-lines, though the splitting should not be noticeable.
  1060.      Splitting will not take place if the `-q' option, which requests
  1061.      filling, is used.
  1062.  
  1063.      The reason for splitting long polygonal lines is that some display
  1064.      devices (e.g., old Postscript printers and HP-GL plotters) have
  1065.      limited buffer sizes.  The environment variable `MAX_LINE_LENGTH'
  1066.      can also be used to specify the maximum line length.  This option
  1067.      has no effect on `graph -T tek' or raw `graph', since they draw
  1068.      polylines in real time and have no buffer limitations.
  1069.  
  1070. `--page-size PAGESIZE'
  1071.      (String, default "letter".)  Set the size of the page on which the
  1072.      plot will be positioned.  This is relevant only to `graph -T ps',
  1073.      `graph -T fig', and `graph -T hpgl'.  "letter" means an 8.5in by
  1074.      11in page.  Any ISO page size in the range "a0"..."a4" or ANSI
  1075.      page size in the range "a"..."e" may be specified ("letter" is an
  1076.      alias for "a" and "tabloid" is an alias for "b").  "legal" and
  1077.      "ledger" are recognized page sizes also.  The environment variable
  1078.      `PAGESIZE' can equally well be used to specify the page size.
  1079.  
  1080.      For `graph -T ps', the graphics display within which the plot is
  1081.      drawn will be a square region centered on the specified page and
  1082.      occupying its full width.  For `graph -T fig', the graphics
  1083.      display will be a square region located in the upper left corner
  1084.      of an `xfig' display, with width equal to the width of the
  1085.      specified page.  `graph -T hpgl', fine control over the
  1086.      positioning of the graphics display on the page can be
  1087.      accomplished by setting certain environment variables (*note graph
  1088.      Environment::.).
  1089.  
  1090. `--pen-colors COLORS'
  1091.      (String, default "1=red:2=green:3=blue:4=magenta:5=cyan".)  Set the
  1092.      colors of the pens used for drawing plots, as numbered, to be
  1093.      COLORS.  The format should be self-explanatory.  An unrecognized
  1094.      name sets the corresponding color to the default.  For information
  1095.      on what names are recognized, see *Note Color Names::.
  1096.  
  1097. `--title-font-name FONT_NAME'
  1098.      (String, default "Helvetica" except for `graph -T hpgl' and `graph
  1099.      -T tek', for which "HersheySerif" is the default.)  Set the font
  1100.      used for the plot title (`top label') to be FONT_NAME.  Normally
  1101.      the font used for the plot title is the same as that used for
  1102.      labelling the axes and the ticks along the axes, as specified by
  1103.      the `-F' option.  But the `--title-font-name' option can be used
  1104.      to override this.  Font names are case-insensitive.  If the
  1105.      specified font is not available, the default font will be used.
  1106.      Which fonts are available depends on which `-T' option is used.
  1107.      For a list of all fonts, see *Note Text Fonts::.  The `plotfont'
  1108.      utility will produce a character map of any available font.  *Note
  1109.      plotfont::.
  1110.  
  1111. `--title-font-size FONT_SIZE'
  1112.      (Float, default 0.07.)  Set the size of the font for the top label
  1113.      (`title'), as specified by the `-L' option, to FONT_SIZE.  The
  1114.      size is expressed as a fraction of the size of the plotting box.
  1115.  
  1116. `--toggle-rotate-y-label'
  1117.      Position the label on the y axis (which is set with the `-Y'
  1118.      option) horizontally instead of vertically, or vice versa.  By
  1119.      default the label is rotated, so that it is positioned parallel to
  1120.      the y axis.  But some display devices (e.g., old X Window System
  1121.      displays) cannot handle rotated fonts.
  1122.  
  1123. `--toggle-switch-axis-end X|Y'
  1124.      Set the end of the indicated axis through which the other axis
  1125.      passes to be the opposite of what is currently the case.  E.g.,
  1126.      `--toggle-switch-axis-end x' will cause the y axis to appear on
  1127.      the right of the plot rather than the left.  (The left end is the
  1128.      default.)  Similarly, `--toggle-switch-axis-end y' will cause the
  1129.      x axis to appear at the top of the plot rather than the bottom.
  1130.      Note that if the x axis appears at the top, no plot title will be
  1131.      drawn (since there will be no room).
  1132.  
  1133. 
  1134. File: plotutils.info,  Node: Dataset Options,  Next: Multiplot Options,  Prev: Plot Options,  Up: graph Invocation
  1135.  
  1136. Dataset options
  1137. ---------------
  1138.  
  1139.    The following options affect the way in which individual datasets are
  1140. read from files, and drawn as part of a plot.  They should appear on the
  1141. command line before the file containing the datasets whose reading or
  1142. rendering they will affect.  They may appear more than once on a command
  1143. line, if more than one file is to be read.
  1144.  
  1145.    The following three options affect the way in which datasets are read
  1146. from files.
  1147.  
  1148. `-I DATA-FORMAT'
  1149. `--input-format DATA-FORMAT'
  1150.      This specifies which format the subsequent input file(s) are in.
  1151.  
  1152.     `a'
  1153.           ASCII format.  Each input file is a sequence of floating
  1154.           point numbers, interpreted as the x and y coordinates of the
  1155.           successive data points in a dataset.  The x and y coordinates
  1156.           of a point need not appear on the same line, and points need
  1157.           not appear on different lines.  But if a blank line occurs
  1158.           (i.e., two newlines in succession are seen), it is
  1159.           interpreted as the end of a dataset, and the beginning of the
  1160.           next.
  1161.  
  1162.     `e'
  1163.           ASCII format, including error bars.  Similar to `a' format,
  1164.           except that triples (x,y,error) appear instead of pairs (x,y).
  1165.  
  1166.     `g'
  1167.           The ASCII `table' format produced by the `gnuplot' plotting
  1168.           program.
  1169.  
  1170.     `f'
  1171.           Single precision binary format.  Each input file is a
  1172.           sequence of single precision floating point numbers,
  1173.           interpreted as forming pairs (x,y).  Successive datasets are
  1174.           separated by a single occurrence of the quantity `FLT_MAX',
  1175.           which is the largest possible single precision floating point
  1176.           number.  On most machines this is approximately 3.4x10^38.
  1177.  
  1178.     `d'
  1179.           Double precision binary format.  Each input file is a
  1180.           sequence of double precision floating point numbers,
  1181.           interpreted as forming pairs (x,y).  Successive datasets are
  1182.           separated by a single occurrence of the quantity `DBL_MAX',
  1183.           which is the largest possible double precision floating point
  1184.           number.  On most machines this is approximately 1.8x10^308.
  1185.  
  1186.     `i'
  1187.           Integer binary format.  Each input file is a sequence of
  1188.           integers, interpreted as forming pairs (x,y).  Successive
  1189.           datasets are separated by a single occurrence of the quantity
  1190.           `INT_MAX', which is the largest possible integer.  On most
  1191.           machines this is 2^31-1.
  1192.  
  1193. `-a [STEP_SIZE [LOWER_LIMIT]]'
  1194. `--auto-abscissa [STEP_SIZE [LOWER_LIMIT]]'
  1195.      (Floats, defaults 1.0 and 0.0.) Automatically generate abscissa
  1196.      (x) values.  Irrespective of data format (`a', `e', `f', `d',
  1197.      or `i'), this option specifies that the abscissa (x) values are
  1198.      missing from the input file: the dataset(s) to be read contain
  1199.      only ordinate (y) values.  The increment from each x value to the
  1200.      next will be STEP_SIZE, and the first x value will be LOWER_LIMIT.
  1201.      To return to reading abscissa values from the input, i.e., for
  1202.      subsequent input files, you would use `-a 0', which disables
  1203.      automatic generation of the abscissa values and returns STEP_SIZE
  1204.      and LOWER_LIMIT to their default values.
  1205.  
  1206. `-B'
  1207. `--toggle-auto-bump'
  1208.      By default the linemode (set with `-m', see below) is `bumped'
  1209.      (incremented by unity) at the beginning of each new dataset.  This
  1210.      option toggles auto-bumping: it turns it off if it was on, and on
  1211.      if it was off.
  1212.  
  1213.    The following options affect the way in which individual datasets are
  1214. drawn as part of a plot.  These options set the six `attributes' (symbol
  1215. type, symbol font, linemode, line width, fill fraction, and
  1216. color/monochrome) that each dataset has.
  1217.  
  1218. `-m LINE_MODE'
  1219. `--line-mode LINE_MODE'
  1220.      (Integer, default 1.) LINE_MODE specifies the mode (i.e., style)
  1221.      of the lines drawn between successive points in a dataset.  By
  1222.      convention, linemode #0 means no line at all (points are
  1223.      disconnected).  If the dataset is being rendered in monochrome, the
  1224.      interpretation of LINE_MODE is as follows.
  1225.  
  1226.        1. solid
  1227.  
  1228.        2. dotted
  1229.  
  1230.        3. dotdashed
  1231.  
  1232.        4. shortdashed
  1233.  
  1234.        5. longdashed
  1235.  
  1236.      Thereafter (i.e., for LINE_MODE greater than 5) the sequence of
  1237.      five linemodes repeats.  So besides linemode #0, there are a total
  1238.      of five distinct monochrome linemodes.  If the dataset is being
  1239.      rendered in color (as may be requested with the `-C' option), the
  1240.      interpretation of linemodes #1 through #5 is instead
  1241.  
  1242.        1. red, solid
  1243.  
  1244.        2. green, solid
  1245.  
  1246.        3. blue, solid
  1247.  
  1248.        4. magenta, solid
  1249.  
  1250.        5. cyan, solid
  1251.  
  1252.      Linemodes #6 through #10 use the same five colors, but are dotted;
  1253.      linemodes #11 through #15 are dotdashed; linemodes #16 through #20
  1254.      are shortdashed; and linemodes #21 through #25 are longdashed.  So
  1255.      besides linemode #0, there are a total of 25 distinct colored
  1256.      linemodes.  A negative linemode indicates that no line should be
  1257.      drawn, but that the plotting symbol, if any (see below), should be
  1258.      in the color of the corresponding positive linemode.
  1259.  
  1260. `-S [SYMBOL_NUMBER [SYMBOL_SIZE]]'
  1261. `--symbol [SYMBOL_NUMBER [SYMBOL_SIZE]]'
  1262.      (Integer and float, defaults 0 and 0.03.) Draw a marker symbol at
  1263.      each data point.  SYMBOL_NUMBER specifies the symbol type, and
  1264.      SYMBOL_SIZE specifies the fractional size of the symbol with
  1265.      respect to the width of the plotting box.  If the dataset is being
  1266.      rendered in color, the symbol will have the color of the line that
  1267.      is being drawn to connect the data points.  You may request that
  1268.      symbols be drawn without any line connecting them by using the
  1269.      `-m' option to specify a negative linemode (see above).  The
  1270.      following table lists the first few marker symbols (by convention,
  1271.      symbol #0 means no symbol at all).
  1272.  
  1273.        1. dot
  1274.  
  1275.        2. plus (+)
  1276.  
  1277.        3. asterisk (*)
  1278.  
  1279.        4. circle
  1280.  
  1281.        5. cross
  1282.  
  1283.      Marker symbols 0 through 31 are furnished by the `libplot' graphics
  1284.      library.  *Note Marker Symbols::.  Symbol numbers greater than or
  1285.      equal to 32 are interpreted as characters to be selected from a
  1286.      symbol font, which can be set with the `--symbol-font-name' option
  1287.      (see below).
  1288.  
  1289. `-W LINE_WIDTH'
  1290. `--line-width LINE_WIDTH'
  1291.      (Float, default -1.0.)  Set the width of the lines used to join
  1292.      successive points in a dataset, as a fraction of the width of the
  1293.      display, to LINE_WIDTH.  A negative value means that the default
  1294.      value for the line width provided by the `libplot' graphics
  1295.      library should be used.  This value is device-dependent.  The
  1296.      interpretation of zero line width is also device-dependent (on some
  1297.      devices, a zero-width line is the thinnest line that can be drawn;
  1298.      on others, a zero-width line is invisible).
  1299.  
  1300.      `graph -T tek' does not support drawing lines with other than a
  1301.      default width, and `graph -T hpgl' does not support doing so if
  1302.      the environment variable `HPGL_VERSION' is set to a value less
  1303.      than "2" (the default).
  1304.  
  1305. `-q FILL_FRACTION'
  1306. `--fill-fraction FILL_FRACTION'
  1307.      (Float, default -1.0.)  If successive points in a dataset are
  1308.      joined by line segments, set the shading intensity for the polygon
  1309.      formed by the line segments to be FILL_FRACTION.  A solid polygon
  1310.      (i.e., one filled with the `pen color' used for drawing the line
  1311.      segments) is obtained by choosing FILL_FRACTION=1.0.  The interior
  1312.      of the polygon will be white if FILL_FRACTION=0.0.  The polygon
  1313.      will be unfilled (transparent) if FILL_FRACTION is negative.
  1314.      If the polygon intersects itself, the `even-odd rule' will be used
  1315.      to determine which points are inside and outside, i.e., to
  1316.      determine which portions of the polygon should be shaded.  The
  1317.      even-odd rule is explained in the `Postscript Language Reference
  1318.      Manual'.  The `-q' option has no effect in `graph -T tek', and it
  1319.      is only partly effective in `graph -T hpgl' if the environment
  1320.      variable `HPGL_VERSION' is set to "1".
  1321.  
  1322. `-C'
  1323. `--toggle-use-color'
  1324.      Toggle between color and monochrome rendering of datasets.  The
  1325.      interpretation of linemode depends on whether the rendering is
  1326.      being performed in color or monochrome; see the `-m' option above.
  1327.  
  1328. `--symbol-font-name SYMBOL_FONT_NAME'
  1329.      (String, default "ZapfDingbats" unless `-T hpgl' or `-T tek' is
  1330.      specified, in which case it is "HersheySerif".)  Set the symbol
  1331.      font, from which plotting symbols numbered 32 and higher are
  1332.      selected, to be SYMBOL_FONT_NAME.  Font names are
  1333.      case-insensitive.  If the specified font is not available, the
  1334.      default font will be used.  Which fonts are available depends on
  1335.      which `-T' option is used.  For example, if the `-T hpgl' is used
  1336.      then normally the Wingdings font, which is an alternative source
  1337.      of symbols, becomes available.  For a list of all fonts, see *Note
  1338.      Text Fonts::.  The `plotfont' utility will produce a character map
  1339.      of any available font.  *Note plotfont::.
  1340.  
  1341. 
  1342. File: plotutils.info,  Node: Multiplot Options,  Next: Raw graph Options,  Prev: Dataset Options,  Up: graph Invocation
  1343.  
  1344. Multiplot options
  1345. -----------------
  1346.  
  1347.    The following options are used for multiplotting (placing several
  1348. plots on a display, or a page, at once).
  1349.  
  1350. `--reposition X Y SIZE'
  1351.      (Floats, defaults 0.0, 0.0, 1.0) Set the `virtual display' within
  1352.      which the next plot will be drawn to be a square of size SIZE, with
  1353.      lower left corner (X,Y).  Normalized coordinates are used here:
  1354.      (0,0) means the lower left corner of the physical display and
  1355.      (1,1) means the upper right corner of the physical display.  The
  1356.      size of the plot within the virtual display may be adjusted with
  1357.      the `-h' and `-w' options, and its position within the virtual
  1358.      display with the `-u' and `-w' options.  After a `--reposition'
  1359.      command, the arguments of those four options will be interpreted in
  1360.      terms of the virtual display, not the physical display.
  1361.  
  1362. `--blankout BLANKOUT_FRACTION'
  1363.      (Float, default 1.3.)  When drawing each additional plot of a
  1364.      multiplot, it is desirable to clear the region of the display on
  1365.      which the plot will be drawn.  If BLANKOUT_FRACTION=1.0, the
  1366.      region covered by the plot's plotting box will be cleared.  If
  1367.      BLANKOUT_FRACTION=1.3, a region 30% larger in each dimension will
  1368.      be cleared.  This is appropriate for inset plots; 1.0 would be
  1369.      appropriate for side by side plots.  Note that `graph -T tek'
  1370.      cannot clear regions, and `graph -T hpgl' cannot clear them if the
  1371.      environment variables `HPGL_VERSION' and `HPGL_OPAQUE_MODE' are
  1372.      set to non-default values (i.e., values other than "2" and "yes",
  1373.      respectively).
  1374.  
  1375. 
  1376. File: plotutils.info,  Node: Raw graph Options,  Next: Info Options,  Prev: Multiplot Options,  Up: graph Invocation
  1377.  
  1378. Raw `graph' options
  1379. -------------------
  1380.  
  1381.    The following option is relevant only to raw `graph', i.e., is
  1382. relevant only if no display type or output format is specified with the
  1383. `-T' option.  In this case `graph' outputs a graphics metafile, which
  1384. may be translated to other formats by invoking `plot'.  This option
  1385. should appear on the command line before any file names, since it
  1386. affects the output of the plot (or multiplot) as a whole.
  1387.  
  1388. `-O'
  1389. `--portable-output'
  1390.      Output the portable (human-readable) version of GNU metafile
  1391.      format, rather than a binary version (the default).
  1392.  
  1393. 
  1394. File: plotutils.info,  Node: Info Options,  Next: graph Environment,  Prev: Raw graph Options,  Up: graph Invocation
  1395.  
  1396. Informational options
  1397. ---------------------
  1398.  
  1399.    The following options request information.
  1400.  
  1401. `--help'
  1402.      Print a list of command-line options, and then exit.
  1403.  
  1404. `--help-fonts'
  1405.      Print a table of available fonts, and then exit.  The table will
  1406.      depend on which display type or output format is specified with
  1407.      the `-T' option.  `graph -T X', `graph -T ps', and `graph -T fig'
  1408.      each support the 35 standard Postscript fonts.  `graph -T hpgl'
  1409.      supports the 45 standard PCL 5 fonts.  All four, together with
  1410.      `graph -T tek', support a set of 22 Hershey vector fonts.  Raw
  1411.      `graph' in principle supports any of these 102 fonts, since its
  1412.      output must be translated to other formats with `plot'.  The
  1413.      `plotfont' utility will produce a character map of any available
  1414.      font.  *Note plotfont::.
  1415.  
  1416. `--list-fonts'
  1417.      Like `--help-fonts', but lists the fonts in a single column to
  1418.      facilitate piping to other programs.  If no display type or output
  1419.      format is specified with the `-T' option, the full set of supported
  1420.      fonts is listed.
  1421.  
  1422. `--version'
  1423.      Print the version number of `graph' and the plotting utilities
  1424.      package, and exit.
  1425.  
  1426. 
  1427. File: plotutils.info,  Node: graph Environment,  Prev: Info Options,  Up: graph Invocation
  1428.  
  1429. Environment variables
  1430. =====================
  1431.  
  1432.    The behavior of `graph' is affected by several environment
  1433. variables.  We have already mentioned the environment variables
  1434. `BITMAPSIZE', `PAGESIZE', `BG_COLOR', and `MAX_LINE_LENGTH'.  They
  1435. serve as backups for the options `--bitmap-size', `--page-size',
  1436. `--bg-color', and `--max-line-length'.  The remaining environment
  1437. variables are specific to individual display types.  They control
  1438. device driver parameters.
  1439.  
  1440.    `graph -T X', which pops up a window on an X Window System display
  1441. and draws graphics in it, checks the `DISPLAY' environment variable.
  1442. The value of this variable determines the display on which the window
  1443. will be popped up.
  1444.  
  1445.    `graph -T hpgl', which produces Hewlett-Packard Graphics Language
  1446. output, is affected by several environment variables.  The most
  1447. important is `HPGL_VERSION', which may be set to "1", "1.5", or "2"
  1448. (the default).  "1" means that the output should be generic HP-GL,
  1449. "1.5" means that the output should be suitable for the HP7550A graphics
  1450. plotter and the HP758x, HP7595A and HP7596A drafting plotters (HP-GL
  1451. with some HP-GL/2 extensions), and "2" means that the output should be
  1452. modern HP-GL/2.  If the version is "1" or "1.5" then the only available
  1453. fonts will be vector fonts, and all lines will be drawn with a default
  1454. width (the `-W' option will not work).  Additionally, if the version
  1455. is "1" then the filling of arbitrary curves with solid color will not
  1456. be supported (the `-q' option may be used to fill circles and
  1457. rectangles aligned with the coordinate axes, though).
  1458.  
  1459.    The position of the `graph -T hpgl' graphics display on the page can
  1460. be adjusted by setting the `HPGL_XOFFSET' and `HPGL_YOFFSET'
  1461. environment variables, which may be specified in centimeters,
  1462. millimeters, or inches.  For example, an offset could be specified as
  1463. "2cm" or "1.2in".  Also, the display can be rotated 90 degrees
  1464. counterclockwise on the page by setting the `HPGL_ROTATE' environment
  1465. variable to "yes".  Besides "no" and "yes", recognized values for this
  1466. variable are "0", "90", "180", and "270".  "no" and "yes" are
  1467. equivalent to "0" and "90", respectively.  "180" and "270" are
  1468. supported only if `HPGL_VERSION' is "2" (the default).
  1469.  
  1470.    *Opaque* filling and the drawing of visible white lines are
  1471. supported only if `HPGL_VERSION' is "2" and the environment variable
  1472. `HPGL_OPAQUE_MODE' is "yes" (the default).  If the value is "no" then
  1473. opaque filling will not be used, and white lines (if any), which are
  1474. normally drawn with pen #0, will not be drawn.  This feature is to
  1475. accommodate older HP-GL/2 devices.  HP-GL/2 pen plotters, for example,
  1476. do not support opacity or the use of pen #0 to draw visible white
  1477. lines.  Some older HP-GL/2 devices reportedly malfunction if asked to
  1478. draw opaque objects.
  1479.  
  1480.    By default, `graph -T hpgl' will draw with a fixed set of pens.
  1481. Which pens are present may be specified by setting the `HPGL_PENS'
  1482. environment variable.  If `HPGL_VERSION' is "1", the default value of
  1483. `HPGL_PENS' is "1=black"; if `HPGL_VERSION' is "1.5" or "2", the
  1484. default value of `HPGL_PENS' is
  1485. "1=black:2=red:3=green:4=yellow:5=blue:6=magenta:7=cyan".  The format
  1486. should be self-explanatory.  By setting `HPGL_PENS', you may specify a
  1487. color for any pen in the range #1...#31.  For information on what color
  1488. names are recognized, see *Note Color Names::.  Pen #1 must always be
  1489. present, though it need not be black. Any other pen in the range
  1490. #1...#31 may be omitted.
  1491.  
  1492.    If `HPGL_VERSION' is "2" then `graph -T hpgl' will also be affected
  1493. by the environment variable `HPGL_ASSIGN_COLORS'.  If the value of this
  1494. variable is "yes", then `graph -T hpgl' will not be restricted to the
  1495. palette specified in `HPGL_PENS': it will assign colors to "logical
  1496. pens" in the range #1...#31, as needed.  The default value is "no"
  1497. because other than color LaserJet printers and DesignJet plotters, not
  1498. many HP-GL/2 devices allow the assignment of colors to logical pens.
  1499.  
  1500.    `graph -T tek', which produces output for a Tektronix terminal or
  1501. emulator, checks the `TERM' environment variable.  If the value of
  1502. `TERM' is `xterm', `xterms', or `kterm', it is taken as a sign that the
  1503. current application is running in an X Window System VT100 terminal
  1504. emulator: an `xterm'.  Before drawing graphics, `graph -T tek' will
  1505. emit an escape sequence that causes the terminal emulator's auxiliary
  1506. Tektronix window, which is normally hidden, to pop up.  After the
  1507. graphics are drawn, an escape sequence that returns control to the
  1508. original VT100 window will be emitted.  The Tektronix window will
  1509. remain on the screen.
  1510.  
  1511.    If the value of `TERM' is `kermit', `ansi.sys', `ansissys',
  1512. `ansi.sysk', or `ansisysk', it is taken as a sign that the current
  1513. application is running in the VT100 terminal emulator provided by the
  1514. MS-DOS version of `kermit'.  Before drawing graphics, `graph -T tek'
  1515. will emit an escape sequence that switches the terminal emulator to
  1516. Tektronix mode.  Also, some of the Tektronix control codes emitted by
  1517. `graph -T tek' will be `kermit'-specific.  There will be a limited
  1518. amount of color support, which is not normally the case (the 16
  1519. `ansi.sys' colors will be supported).  After drawing graphics, `graph
  1520. -T tek' will emit an escape sequence that returns the emulator to VT100
  1521. mode.  The key sequence `ALT minus' can be employed manually within
  1522. `kermit' to switch between the two modes.
  1523.  
  1524. 
  1525. File: plotutils.info,  Node: plot,  Next: tek2plot,  Prev: graph,  Up: Top
  1526.  
  1527. The `plot' Program
  1528. ******************
  1529.  
  1530. * Menu:
  1531.  
  1532. * plot Examples::       How to use a plot filter
  1533. * plot Invocation::     Command-line options
  1534. * plot Environment::    Environment variables
  1535.  
  1536. 
  1537. File: plotutils.info,  Node: plot Examples,  Next: plot Invocation,  Prev: plot,  Up: plot
  1538.  
  1539. How to use `plot'
  1540. =================
  1541.  
  1542.    The GNU plot filter `plot' displays GNU graphics metafiles, or
  1543. translates them to other formats.  The `-T' option is used to specify
  1544. the display type or output format.
  1545.  
  1546.    Graphics metafiles are produced by the `graph' utility if no `-T'
  1547. option is specified on its command line, and can also be produced by
  1548. the `libplot' library.  The metafile format is a device-independent
  1549. format for storage of graphic data.  By default, it is a binary rather
  1550. than an human-readable format (*note Metafiles::.).
  1551.  
  1552.    `plot', like the metafile format itself, is useful if you wish to
  1553. preserve a plot that is to be displayed or edited on more than one type
  1554. of display.  The following illustrate how this is done.
  1555.  
  1556.    To produce a plot of data arranged as alternating x and y
  1557. coordinates in an ASCII file, you may use raw `graph' as follows:
  1558.  
  1559.      graph < ascii_data_file > test.plot
  1560.  
  1561. The file `test.plot' will be a GNU graphics metafile.  Similarly, to
  1562. create a plot consisting of a simple figure, you may do:
  1563.  
  1564.      echo 0 0 1 1 2 0 | spline | graph > test.plot
  1565.  
  1566. To display any such plot on an X Window System display, you would do
  1567.  
  1568.      plot -T X test.plot
  1569.  
  1570. or
  1571.  
  1572.      plot -T X < test.plot
  1573.  
  1574. To print the plot on a Postscript printer, you would do something like
  1575.  
  1576.      plot -T ps < test.plot | lpr
  1577.  
  1578. To edit it with the `idraw' drawing editor, you would do
  1579.  
  1580.      plot -T ps < test.plot > test.ps
  1581.      idraw test.ps
  1582.  
  1583. And to produce a plot that can be edited with the `xfig' drawing
  1584. editor, you would do
  1585.  
  1586.      plot -T fig < test.plot > test.fig
  1587.      xfig test.fig
  1588.  
  1589.    `plot' may behave differently depending on the environment in which
  1590. it is invoked.  In particular, `plot -T ps', `plot -T fig', and `plot
  1591. -T hpgl' are affected by the environment variable `PAGESIZE'.  `plot
  1592. -T X' is affected by the environment variables `DISPLAY' and
  1593. `BITMAPSIZE', and `plot -T tek' is affected by the environment variable
  1594. `TERM'.  There are also several environment variables that affect the
  1595. operation of `plot -T hpgl'.  For a complete discussion of the effects
  1596. of the environment on `plot', see *Note plot Environment::.
  1597.  
  1598. 
  1599. File: plotutils.info,  Node: plot Invocation,  Next: plot Environment,  Prev: plot Examples,  Up: plot
  1600.  
  1601. `plot' command-line options
  1602. ===========================
  1603.  
  1604.    The plot filter `plot' translates GNU graphics metafiles to other
  1605. formats.  The `-T' option is used to specify the display type or output
  1606. format.  Files in metafile format are produced by GNU `graph' and other
  1607. applications that use the GNU `libplot' graphics library.  For
  1608. technical details on the metafile format, see *Note Metafiles::.
  1609.  
  1610.    Input file names may be specified anywhere on the command line.  That
  1611. is, the relative order of file names and command-line options does not
  1612. matter.  If no file names are specified, or the file name `-' is
  1613. specified, the standard input is read.
  1614.  
  1615.    The full set of command-line options is listed below.  There are four
  1616. sorts of option:
  1617.  
  1618.   1. Options setting the values of drawing parameters.
  1619.  
  1620.   2. Options relevant only to raw `plot', i.e., relevant only if no
  1621.      display type or output format is specified with the `-T' option.
  1622.  
  1623.   3. Options specifying the type of metafile format the input is in (for
  1624.      backward compatibility only).
  1625.  
  1626.   4. Options requesting information (e.g., `--help').
  1627.  
  1628. Each option that takes an argument is followed, in parentheses, by the
  1629. type and default value of the argument.
  1630.  
  1631.    The following options set the values of drawing parameters.
  1632.  
  1633. `-T TYPE'
  1634. `--display-type TYPE'
  1635.      (String, default "meta".)  Select a display type or output format
  1636.      of TYPE, which may be one of the strings "X", "ps", "fig", "hpgl",
  1637.      "tek", and "meta".  These refer respectively to the
  1638.      X Window System, `idraw'-editable Postscript, the format used by
  1639.      the `xfig' drawing editor, the Hewlett-Packard Graphics Language,
  1640.      Tektronix format, and device-independent GNU metafile format.
  1641.  
  1642. `-p N'
  1643. `--page-number N'
  1644.      (Positive integer.) Display only page number N, within the
  1645.      metafile or sequence of metafiles that is being translated.
  1646.      Metafiles may consist of one or more pages, numbered beginning
  1647.      with 1.
  1648.  
  1649.      The default behavior, if `-p' is not used, is to display all pages.
  1650.      For example, `plot -T X' displays each page in its own X window.
  1651.      If the `-T fig' option is used, the default behavior is to display
  1652.      only the first page, since files to be edited by `xfig' may
  1653.      contain only a single page of graphics.
  1654.  
  1655.      Most metafiles produced by the GNU plotting utilities (e.g., by raw
  1656.      `graph') contain only a single page.
  1657.  
  1658. `--bitmap-size BITMAP_SIZE'
  1659.      (String, default "570x570".)  Set the size of the graphics display
  1660.      in which the plot will be drawn, in terms of pixels, to be
  1661.      BITMAP_SIZE.  This is relevant only to `graph -T X', for which the
  1662.      graphics display is an X window.  If you choose a rectangular
  1663.      (non-square) window size, the fonts in the plot will be scaled
  1664.      anisotropically, i.e., by different factors in the horizontal and
  1665.      vertical direction.  This requires an X11R6 display.  Any font that
  1666.      cannot be scaled in this way will be replaced by a default scalable
  1667.      font, such as the Hershey vector font "HersheySerif".
  1668.  
  1669.      The environment variable `BITMAPSIZE' can equally well be used to
  1670.      specify the window size.  For backward compatibility, the
  1671.      X resource `Xplot.geometry', which can be set by the user, may be
  1672.      used instead.
  1673.  
  1674. `--max-line-length MAX_LINE_LENGTH'
  1675.      (Integer, default 500.) Set the maximum number of points that a
  1676.      polygonal line may contain, before it is flushed to the display
  1677.      device, to equal MAX_LINE_LENGTH.  If this flushing occurs, the
  1678.      polygonal line will be split into two or more sub-lines, though
  1679.      the splitting should not be noticeable.  Splitting will not take
  1680.      place if the line is the boundary of a filled polygon.
  1681.  
  1682.      The reason for splitting long polygonal lines is that some display
  1683.      devices (e.g., old Postscript printers and HP-GL plotters) have
  1684.      limited buffer sizes.  The environment variable `MAX_LINE_LENGTH'
  1685.      can also be used to specify the maximum line length.  This option
  1686.      has no effect on `plot -T tek' or raw `plot', since they draw
  1687.      polylines in real time and have no buffer limitations.
  1688.  
  1689. `--page-size PAGESIZE'
  1690.      (String, default "letter".) Set the size of the page on which the
  1691.      plot will be positioned.  This is relevant only to `plot -T ps',
  1692.      `plot -T fig', and `plot -T hpgl'.  "letter" means an 8.5in by
  1693.      11in page.  Any ISO page size in the range "a0"..."a4" or ANSI
  1694.      page size in the range "a"..."e" may be specified ("letter" is an
  1695.      alias for "a" and "tabloid" is an alias for "b").  "legal" and
  1696.      "ledger" are recognized page sizes also.  The environment variable
  1697.      `PAGESIZE' can equally well be used to specify the page size.
  1698.  
  1699.      For `plot -T ps', the graphics display within which the plot is
  1700.      drawn will be a square region centered on the specified page and
  1701.      occupying its full width.  For `plot -T fig', the graphics display
  1702.      will be a square region located in the upper left corner of an
  1703.      `xfig' display, with width equal to the width of the specified
  1704.      page.  For `plot -T hpgl', fine control over the positioning of
  1705.      the graphics display on the page may be accomplished by setting
  1706.      certain environment variables (*note plot Environment::.).
  1707.  
  1708.    The following options set the initial values of additional drawing
  1709. parameters.  All of these may be overridden by directives in the
  1710. metafile itself.  In fact, these options are useful mostly for plotting
  1711. old metafiles in the pre-GNU `plot(5)' format, which did not include
  1712. such directives.
  1713.  
  1714. `--bg-color NAME'
  1715.      (String, default "white".)  Set the color used for the drawing
  1716.      background to be NAME.  This is currently relevant only to `plot
  1717.      -T X'.  An unrecognized name sets the color to the default.  For
  1718.      information on what names are recognized, see *Note Color Names::.
  1719.      The environment variable `BG_COLOR' can equally well be used to
  1720.      specify the background color.
  1721.  
  1722. `-f FONT_SIZE'
  1723. `--font-size FONT_SIZE'
  1724.      (Float, default 0.0525.)  Set the initial size of the font used
  1725.      for rendering text, as a fraction of the width of the display
  1726.      device, to FONT_SIZE.
  1727.  
  1728. `-F FONT_NAME'
  1729. `--font-name FONT_NAME'
  1730.      (String, default "Helvetica" except for `plot -T hpgl' and `plot
  1731.      -T tek', for which "HersheySerif" is the default.)  Set the font
  1732.      initially used for text (i.e., for `labels') to FONT_NAME.  Font
  1733.      names are case-insensitive.  If the specified font is not
  1734.      available, the default font will be used.  Which fonts are
  1735.      available depends on which `-T' option is used.  For a list of all
  1736.      fonts, see *Note Text Fonts::.  The `plotfont' utility will
  1737.      produce a character map of any available font.  *Note plotfont::.
  1738.  
  1739. `-W LINE_WIDTH'
  1740. `--line-width LINE_WIDTH'
  1741.      (Float, default -1.0.)  Set the width of lines, as a fraction of
  1742.      the width of the display, to LINE_WIDTH.  A negative value means
  1743.      that the default value provided by the `libplot' graphics library
  1744.      should be used.  This value is device-dependent.  The
  1745.      interpretation of zero line width is also device-dependent (on some
  1746.      devices, a zero-width line is the thinnest line that can be drawn;
  1747.      on others, a zero-width line is invisible).
  1748.  
  1749.      `plot -T tek' does not support drawing lines with other than a
  1750.      default width, and `plot -T hpgl' does not support doing so if the
  1751.      environment variable `HPGL_VERSION' is set to a value less
  1752.      than "2" (the default).
  1753.  
  1754. `--pen-color NAME'
  1755.      (String, default "black".)  Set the pen color to be NAME.  An
  1756.      unrecognized name sets the pen color to the default.  For
  1757.      information on what color names are recognized, see *Note Color
  1758.      Names::.
  1759.  
  1760.    The following option is relevant only to raw `plot', i.e., relevant
  1761. only if no output type is specified with the `-T' option.  In this case
  1762. `plot' outputs a graphics metafile, which may be translated to other
  1763. formats by a second invocation of `plot'.
  1764.  
  1765. `-O'
  1766. `--portable-output'
  1767.      Output the portable (human-readable) version of GNU metafile
  1768.      format, rather than a binary version (the default).
  1769.  
  1770.    `plot' will automatically determine which type of GNU metafile
  1771. format the input is in.  There are two types: binary (the default) and
  1772. portable (human-readable).  The binary format is machine-dependent.
  1773. *Note Metafiles::.
  1774.  
  1775.    For compatibility with older plotting software, the reading of input
  1776. files in the pre-GNU `plot(5)' format is also supported.  This is
  1777. normally a binary format, with each integer in the metafile represented
  1778. as a pair of bytes.  The order of the two bytes is machine dependent.
  1779. You may specify that input file(s) are in plot(5) format rather than
  1780. ordinary GNU metafile format by using either the `-h' option ("high
  1781. byte first") or the `-l' option ("low byte first"), whichever is
  1782. appropriate.  Some non-GNU systems support an ASCII (human-readable)
  1783. variant of plot(5) format.  You may specify that the input is in this
  1784. format by using the `-A' option.  Irrespective of the variant, a file
  1785. in plot(5) format includes only one page of graphics.
  1786.  
  1787. `-h'
  1788. `--high-byte-first-input'
  1789.      Input file(s) are assumed to be in traditional `plot(5)' metafile
  1790.      format, with the high-order byte of each integer occurring first.
  1791.  
  1792. `-l'
  1793. `--low-byte-first-input'
  1794.      Input file(s) are assumed to be in traditional `plot(5)' metafile
  1795.      format, with the low-order byte of each integer occurring first.
  1796.  
  1797. `-A'
  1798. `--ascii-input'
  1799.      Input file(s) are assumed to be in the ASCII variant of traditional
  1800.      `plot(5)' metafile format.
  1801.  
  1802.    The following options request information.
  1803.  
  1804. `--help'
  1805.      Print a list of command-line options, and then exit.
  1806.  
  1807. `--help-fonts'
  1808.      Print a table of available fonts, and then exit.  The table will
  1809.      depend on which display type or output format is specified with
  1810.      the `-T' option.  `plot -T X', `plot -T ps', and `plot -T fig'
  1811.      each support the 35 standard Postscript fonts.  `plot -T hpgl'
  1812.      supports the 45 standard PCL 5 fonts.  All four, together with
  1813.      `plot -T hpgl' and `plot -T tek', support a set of 22 Hershey
  1814.      vector fonts.  Raw `plot' in principle supports any of these 102
  1815.      fonts, since its output may be translated to any other format by a
  1816.      later invocation of `plot'.
  1817.  
  1818. `--list-fonts'
  1819.      Like `--help-fonts', but lists the fonts in a single column to
  1820.      facilitate piping to other programs.  If no display type or output
  1821.      format is specified with the `-T' option, the full set of supported
  1822.      fonts is listed.
  1823.  
  1824. `--version'
  1825.      Print the version number of `plot' and the plotting utilities
  1826.      package, and exit.
  1827.  
  1828. 
  1829. File: plotutils.info,  Node: plot Environment,  Prev: plot Invocation,  Up: plot
  1830.  
  1831. Environment variables
  1832. =====================
  1833.  
  1834.    The behavior of `plot' is affected by several environment variables.
  1835. We have already mentioned the environment variables `BITMAPSIZE',
  1836. `PAGESIZE', `BG_COLOR', and `MAX_LINE_LENGTH'.  They serve as backups
  1837. for the options `--bitmap-size', `--page-size', `--bg-color', and
  1838. `--max-line-length'.  The remaining environment variables are specific
  1839. to individual display types.  They control device driver parameters.
  1840.  
  1841.    `plot -T X', which pops up a window on an X Window System display
  1842. and draws graphics in it, checks the `DISPLAY' environment variable.
  1843. The value of this variable determines the display on which the window
  1844. will be popped up.
  1845.  
  1846.    `plot -T hpgl', which produces Hewlett-Packard Graphics Language
  1847. output, is affected by several environment variables.  The most
  1848. important is `HPGL_VERSION', which may be set to "1", "1.5", or "2"
  1849. (the default).  "1" means that the output should be generic HP-GL,
  1850. "1.5" means that the output should be suitable for the HP7550A graphics
  1851. plotter and the HP758x, HP7595A and HP7596A drafting plotters (HP-GL
  1852. with some HP-GL/2 extensions), and "2" means that the output should be
  1853. modern HP-GL/2.  If the version is "1" or "1.5" then the only available
  1854. fonts will be vector fonts, and all lines will be drawn with a default
  1855. width (the `-W' option will not work).  Additionally, if the version
  1856. is "1" then the filling of arbitrary curves with solid color will not
  1857. be supported (circles and rectangles aligned with the coordinate axes
  1858. may be filled, though).
  1859.  
  1860.    The position of the `plot -T hpgl' graphics display on the page can
  1861. be adjusted by setting the `HPGL_XOFFSET' and `HPGL_YOFFSET'
  1862. environment variables, which may be specified in centimeters,
  1863. millimeters, or inches.  For example, an offset could be specified as
  1864. "2cm" or "1.2in".  Also, the display can be rotated 90 degrees
  1865. counterclockwise on the page by setting the `HPGL_ROTATE' environment
  1866. variable to "yes".  Besides "no" and "yes", recognized values for this
  1867. variable are "0", "90", "180", and "270".  "no" and "yes" are
  1868. equivalent to "0" and "90", respectively.  "180" and "270" are
  1869. supported only if `HPGL_VERSION' is "2" (the default).
  1870.  
  1871.    *Opaque* filling and the drawing of visible white lines are
  1872. supported only if `HPGL_VERSION' is "2" and the environment variable
  1873. `HPGL_OPAQUE_MODE' is "yes" (the default).  If the value is "no" then
  1874. opaque filling will not be used, and white lines (if any), which are
  1875. normally drawn with pen #0, will not be drawn.  This feature is to
  1876. accommodate older HP-GL/2 devices.  HP-GL/2 pen plotters, for example,
  1877. do not support opacity or the use of pen #0 to draw visible white
  1878. lines.  Some older HP-GL/2 devices reportedly malfunction if asked to
  1879. draw opaque objects.
  1880.  
  1881.    By default, `plot -T hpgl' will draw with a fixed set of pens.
  1882. Which pens are present may be specified by setting the `HPGL_PENS'
  1883. environment variable.  If `HPGL_VERSION' is "1", the default value of
  1884. `HPGL_PENS' is "1=black"; if `HPGL_VERSION' is "1.5" or "2", the
  1885. default value of `HPGL_PENS' is
  1886. "1=black:2=red:3=green:4=yellow:5=blue:6=magenta:7=cyan".  The format
  1887. should be self-explanatory.  By setting `HPGL_PENS', you may specify a
  1888. color for any pen in the range #1...#31.  For information on what color
  1889. names are recognized, see *Note Color Names::.  Pen #1 must always be
  1890. present, though it need not be black. Any other pen in the range
  1891. #1...#31 may be omitted.
  1892.  
  1893.    If `HPGL_VERSION' is "2" then `plot -T hpgl' will also be affected
  1894. by the environment variable `HPGL_ASSIGN_COLORS'.  If the value of this
  1895. variable is "yes", then `plot -T hpgl' will not be restricted to the
  1896. palette specified in `HPGL_PENS': it will assign colors to "logical
  1897. pens" in the range #1...#31, as needed.  The default value is "no"
  1898. because other than color LaserJet printers and DesignJet plotters, not
  1899. many HP-GL/2 devices allow the assignment of colors to logical pens.
  1900.  
  1901.    `plot -T tek', which produces output for a Tektronix terminal or
  1902. emulator, checks the `TERM' environment variable.  If the value of
  1903. `TERM' is `xterm', `xterms', or `kterm', it is taken as a sign that the
  1904. current application is running in an X Window System VT100 terminal
  1905. emulator: an `xterm'.  Before drawing graphics, `plot -T tek' will emit
  1906. an escape sequence that causes the terminal emulator's auxiliary
  1907. Tektronix window, which is normally hidden, to pop up.  After the
  1908. graphics are drawn, an escape sequence that returns control to the
  1909. original VT100 window will be emitted.  The Tektronix window will
  1910. remain on the screen.
  1911.  
  1912.    If the value of `TERM' is `kermit', `ansi.sys', `ansissys',
  1913. `ansi.sysk', or `ansisysk', it is taken as a sign that the current
  1914. application is running in the VT100 terminal emulator provided by the
  1915. MS-DOS version of `kermit'.  Before drawing graphics, `plot -T tek'
  1916. will emit an escape sequence that switches the terminal emulator to
  1917. Tektronix mode.  Also, some of the Tektronix control codes emitted by
  1918. `plot -T tek' will be `kermit'-specific.  There will be a limited
  1919. amount of color support, which is not normally the case (the 16
  1920. `ansi.sys' colors will be supported).  After drawing graphics, `plot -T
  1921. tek' will emit an escape sequence that returns the emulator to VT100
  1922. mode.  The key sequence `ALT minus' can be employed manually within
  1923. `kermit' to switch between the two modes.
  1924.  
  1925. 
  1926. File: plotutils.info,  Node: tek2plot,  Next: plotfont,  Prev: plot,  Up: Top
  1927.  
  1928. The `tek2plot' Program
  1929. **********************
  1930.  
  1931. * Menu:
  1932.  
  1933. * tek2plot Introduction::     What tek2plot is used for
  1934. * tek2plot Invocation::       Command-line options
  1935. * tek2plot Environment::      Environment variables
  1936.  
  1937. 
  1938. File: plotutils.info,  Node: tek2plot Introduction,  Next: tek2plot Invocation,  Prev: tek2plot,  Up: tek2plot
  1939.  
  1940. What `tek2plot' is used for
  1941. ===========================
  1942.  
  1943.    GNU `tek2plot' is a command-line Tektronix translator.  It displays
  1944. Tektronix graphics files, or translates them to other formats.  The
  1945. supported output formats are the same formats that are supported by the
  1946. GNU `graph' and `plot' utilities.  `tek2plot' will take input from a
  1947. file specified on the command line or from standard input, just as the
  1948. plot filter `plot' does.
  1949.  
  1950.    Tektronix graphics files are produced by many legacy applications.
  1951. A directory containing sample Tektronix files, which you may experiment
  1952. with, is distributed along with the GNU plotting utilities.  On most
  1953. systems it is installed as `/usr/share/tek2plot' or
  1954. `/usr/local/share/tek2plot'.
  1955.  
  1956.    Tektronix graphics format is defined as a noninteractive version of
  1957. the graphics format understood by Tektronix 4010/4014 terminals, as
  1958. documented in the `4014 Service Manual', Tektronix Inc., 1974
  1959. (Tektronix Part #070-1648-00).  `tek2plot' does not support interactive
  1960. features such as GIN mode and status enquiry.  However, it does support
  1961. a few features of popular Tektronix emulators, such as the color
  1962. extensions supported by the Tektronix emulator contained in the MS-DOS
  1963. version of `kermit'.
  1964.  
  1965. 
  1966. File: plotutils.info,  Node: tek2plot Invocation,  Next: tek2plot Environment,  Prev: tek2plot Introduction,  Up: tek2plot
  1967.  
  1968. `tek2plot' command-line options
  1969. ===============================
  1970.  
  1971.    The `tek2plot' program translates the Tektronix graphics files
  1972. produced by many legacy applications to other formats.  The output
  1973. format or display type is specified with the `-T' option.  The possible
  1974. output formats are the same six formats that are supported by the GNU
  1975. `graph' and `plot' programs.
  1976.  
  1977.    Input file names may be specified anywhere on the command line.  That
  1978. is, the relative order of file names and command-line options does not
  1979. matter.  If no file names are specified, or the file name `-' is
  1980. specified, the standard input is read.
  1981.  
  1982.    The full set of command-line options is listed below.  There are
  1983. three sorts of option:
  1984.  
  1985.   1. General options.
  1986.  
  1987.   2. Options relevant only to raw `tek2plot', i.e., relevant only if no
  1988.      display type or output format is specified with the `-T' option.
  1989.  
  1990.   3. Options requesting information (e.g., `--help').
  1991.  
  1992. Each option that takes an argument is followed, in parentheses, by the
  1993. type and default value of the argument.
  1994.  
  1995.    The following are general options.
  1996.  
  1997. `-T TYPE'
  1998. `--display-type TYPE'
  1999.      (String, default "meta".)  Select a display type or output format
  2000.      of TYPE, which may be one of the strings "X", "ps", "fig", "hpgl",
  2001.      "tek", and "meta".  These refer respectively to the
  2002.      X Window System, `idraw'-editable Postscript, the format used by
  2003.      the `xfig' drawing editor, the Hewlett-Packard Graphics Language,
  2004.      Tektronix format, and device-independent GNU metafile format.
  2005.  
  2006. `-p N'
  2007. `--page-number N'
  2008.      (Nonnegative integer.) Display only page number N, within the
  2009.      Tektronix file or sequence of Tektronix files that is being
  2010.      translated.  Tektronix files may consist of one or more pages,
  2011.      numbered beginning with zero.
  2012.  
  2013.      The default behavior, if the `-p' option is not used, is to display
  2014.      all nonempty pages in succession.  For example, `tek2plot -T X'
  2015.      displays each page in its own X window.  If the `-T fig' option is
  2016.      used, the default behavior is to display only the first nonempty
  2017.      Tektronix page, since files to be edited by `xfig' may contain only
  2018.      a single page of graphics.
  2019.  
  2020.      Most Tektronix files consist of either one page (page #0) or two
  2021.      pages (an empty page #0, and page #1).  Tektronix files produced
  2022.      by the GNU plotting utilities (e.g., by `graph -T tek') are
  2023.      normally of the latter sort.
  2024.  
  2025. `-F FONT_NAME'
  2026. `--font-name FONT_NAME'
  2027.      (String, default "Courier" except for `tek2plot -T hpgl', for which
  2028.      "HersheySerif" is the default.)  Set the font used for text to
  2029.      FONT_NAME.  Font names are case-insensitive.  If a font outside
  2030.      the Courier family is chosen, the `--position-chars' option (see
  2031.      below) should probably be used.  For a list of all fonts, see
  2032.      *Note Text Fonts::.  If the specified font is not available, the
  2033.      default font will be used.
  2034.  
  2035. `-W LINE_WIDTH'
  2036. `--line-width LINE_WIDTH'
  2037.      (Float, default -1.0.)  Set the width of lines, as a fraction of
  2038.      the width of the display, to LINE_WIDTH.  A negative value means
  2039.      that the default value provided by the `libplot' graphics library
  2040.      should be used.  This value is device-dependent.  The
  2041.      interpretation of zero line width is also device-dependent (on some
  2042.      devices, a zero-width line is the thinnest line that can be drawn;
  2043.      on others, a zero-width line is invisible).
  2044.  
  2045.      `tek2plot -T hpgl' does not support drawing lines with other than a
  2046.      default width if the environment variable `HPGL_VERSION' is set to
  2047.      a value less than "2" (the default).
  2048.  
  2049. `--bg-color NAME'
  2050.      (String, default "white".)  Set the color used for the background
  2051.      to be NAME.  This is currently relevant only to `tek2plot -T X'.
  2052.      An unrecognized name sets the color to the default.  For
  2053.      information on what names are recognized, see *Note Color Names::.
  2054.      The environment variable `BG_COLOR' can equally well be used to
  2055.      specify the background color.
  2056.  
  2057. `--bitmap-size BITMAP_SIZE'
  2058.      (String, default "570x570".)  Set the size of the graphics display
  2059.      in which the plot will be drawn, in terms of pixels, to be
  2060.      BITMAP_SIZE.  This is relevant only to `graph -T X', for which the
  2061.      graphics display is an X window.  If you choose a rectangular
  2062.      (non-square) window size, the fonts in the plot will be scaled
  2063.      anisotropically, i.e., by different factors in the horizontal and
  2064.      vertical direction.  This requires an X11R6 display.  Any font that
  2065.      cannot be scaled in this way will be replaced by a default scalable
  2066.      font, such as the Hershey vector font "HersheySerif".
  2067.  
  2068.      The environment variable `BITMAPSIZE' can equally well be used to
  2069.      specify the window size.  For backward compatibility, the
  2070.      X resource `Xplot.geometry', which can be set by the user, may be
  2071.      used instead.
  2072.  
  2073. `--max-line-length MAX_LINE_LENGTH'
  2074.      (Integer, default 500.) Set the maximum number of points that a
  2075.      polygonal line may contain, before it is flushed to the display
  2076.      device, to equal MAX_LINE_LENGTH.  If this flushing occurs, the
  2077.      polygonal line will be split into two or more sub-lines, though
  2078.      the splitting should not be noticeable.
  2079.  
  2080.      The reason for splitting long polygonal lines is that some display
  2081.      devices (e.g., old Postscript printers and HP-GL plotters) have
  2082.      limited buffer sizes.  The environment variable `MAX_LINE_LENGTH'
  2083.      can also be used to specify the maximum line length.  This option
  2084.      has no effect on raw `tek2plot', since it draws polylines in real
  2085.      time and has no buffer limitations.
  2086.  
  2087. `--page-size PAGESIZE'
  2088.      (String, default "letter".) Set the size of the page on which the
  2089.      plot will be positioned.  This is relevant only to `tek2plot -T
  2090.      ps', `tek2plot -T fig', and `tek2plot -T hpgl'.  "letter" means an
  2091.      8.5in by 11in page.  Any ISO page size in the range "a0"..."a4" or
  2092.      ANSI page size in the range "a"..."e" may be specified ("letter"
  2093.      is an alias for "a" and "tabloid" is an alias for "b").  "legal"
  2094.      and "ledger" are recognized page sizes also.  The environment
  2095.      variable `PAGESIZE' can equally well be used to specify the page
  2096.      size.
  2097.  
  2098.      For `tek2plot -T ps', the graphics display within which the plot is
  2099.      drawn will be a square region centered on the specified page and
  2100.      occupying its full width.  For `tek2plot -T fig', the graphics
  2101.      display will be a square region located in the upper left corner
  2102.      of an `xfig' display, with width equal to the width of the
  2103.      specified page.  For `tek2plot -T hpgl', fine control over the
  2104.      positioning of the graphics display on the page can be
  2105.      accomplished by setting certain environment variables (*note
  2106.      tek2plot Environment::.).
  2107.  
  2108. `--pen-color NAME'
  2109.      (String, default "black".)  Set the pen color to be NAME.  An
  2110.      unrecognized name sets the pen color to the default.  For
  2111.      information on what color names are recognized, see *Note Color
  2112.      Names::.
  2113.  
  2114. `--position-chars'
  2115.      Position the characters in each text string individually on the
  2116.      display.  If the text font is not a member of the Courier family,
  2117.      and especially if it is not a fixed-width font, this option is
  2118.      recommended.  It will improve the appearance of text strings, at
  2119.      the price of making it difficult to edit the output file with
  2120.      `xfig' or `idraw'.
  2121.  
  2122. `--use-tek-fonts'
  2123.      Use the bitmap fonts that were used on the original Tektronix
  2124.      4010/4014 terminal.  This option is relevant only to `tek2plot
  2125.      -T X'.  The four relevant bitmap fonts are distributed with most
  2126.      versions of the plotting utilities package, under the names
  2127.      `tekfont0'...`tekfont3'.  They can easily be installed on any
  2128.      modern X Window System display.  For this option to work properly,
  2129.      you must also select a window size of 1024x1024 pixels, either by
  2130.      using the `--bitmap-size 1024x1024' option or by setting the value
  2131.      of the `Xplot.geometry' resource.  The reason for this restriction
  2132.      is that bitmap fonts, unlike the scalable fonts that the plotting
  2133.      utilities normally use, cannot be rescaled.
  2134.  
  2135.      This option is useful only if you have a file in Tektronix format
  2136.      that draws text using native Tektronix fonts.  Tektronix files
  2137.      produced by the GNU plotting utilities (e.g., by `graph -T tek')
  2138.      do not use native Tektronix fonts to draw text.
  2139.  
  2140.    The following option is relevant only to raw `tek2plot', i.e.,
  2141. relevant only if no display type or output format is specified with the
  2142. `-T' option.  In this case `tek2plot' outputs a graphics metafile,
  2143. which may be translated to other formats by invoking `plot'.
  2144.  
  2145. `-O'
  2146. `--portable-output'
  2147.      Output the portable (human-readable) version of GNU metafile
  2148.      format, rather than a binary version (the default).
  2149.  
  2150.    The following options request information.
  2151.  
  2152. `--help'
  2153.      Print a list of command-line options, and then exit.
  2154.  
  2155. `--help-fonts'
  2156.      Print a table of available fonts, and then exit.  The table will
  2157.      depend on which display type or output format is specified with
  2158.      the `-T' option.  `tek2plot -T X', `tek2plot -T ps', and `tek2plot
  2159.      -T fig' each support the 35 standard Postscript fonts.  `tek2plot
  2160.      -T hpgl' supports the 45 standard PCL 5 fonts.  All four, together
  2161.      with `tek2plot -T hpgl', support a set of 22 Hershey vector fonts.
  2162.      Raw `tek2plot' in principle supports any of these 102 fonts,
  2163.      since its output must be translated to other formats with `plot'.
  2164.  
  2165. `--list-fonts'
  2166.      Like `--help-fonts', but lists the fonts in a single column to
  2167.      facilitate piping to other programs.  If no display type or output
  2168.      format is specified with the `-T' option, the full set of supported
  2169.      fonts is listed.
  2170.  
  2171. `--version'
  2172.      Print the version number of `tek2plot' and the plotting utilities
  2173.      package, and exit.
  2174.  
  2175. 
  2176. File: plotutils.info,  Node: tek2plot Environment,  Prev: tek2plot Invocation,  Up: tek2plot
  2177.  
  2178. Environment variables
  2179. =====================
  2180.  
  2181.    The behavior of `tek2plot' is affected by several environment
  2182. variables, which are the same as those that affect `graph' and `plot'.
  2183. For convenience, we list them here.
  2184.  
  2185.    We have already mentioned the environment variables `BITMAPSIZE',
  2186. `PAGESIZE', `BG_COLOR', and `MAX_LINE_LENGTH'.  They serve as backups
  2187. for the options `--bitmap-size', `--page-size', `--bg-color', and
  2188. `--max-line-length'.  The remaining environment variables are specific
  2189. to individual display devices.  They control device driver parameters.
  2190.  
  2191.    `tek2plot -T X', which pops up a window on an X Window System
  2192. display and draws graphics in it, checks the `DISPLAY' environment
  2193. variable.  The value of this variable determines the display on which
  2194. the window will be popped up.
  2195.  
  2196.    `tek2plot -T hpgl', which produces Hewlett-Packard Graphics Language
  2197. output, is affected by several environment variables.  The most
  2198. important is `HPGL_VERSION', which may be set to "1", "1.5", or "2"
  2199. (the default).  "1" means that the output should be generic HP-GL,
  2200. "1.5" means that the output should be suitable for the HP7550A graphics
  2201. plotter and the HP758x, HP7595A and HP7596A drafting plotters (HP-GL
  2202. with some HP-GL/2 extensions), and "2" means that the output should be
  2203. modern HP-GL/2.  If the version is "1" or "1.5" then the only available
  2204. fonts will be vector fonts, and all lines will be drawn with a default
  2205. width (the `-W' option will not work).
  2206.  
  2207.    The position of the `tek2plot -T hpgl' graphics display on the page
  2208. can be adjusted by setting the `HPGL_XOFFSET' and `HPGL_YOFFSET'
  2209. environment variables, which may be specified in centimeters,
  2210. millimeters, or inches.  For example, an offset could be specified as
  2211. "2cm" or "1.2in".  Also, the display can be rotated 90 degrees
  2212. counterclockwise on the page by setting the `HPGL_ROTATE' environment
  2213. variable to "yes".  Besides "no" and "yes", recognized values for this
  2214. variable are "0", "90", "180", and "270".  "no" and "yes" are
  2215. equivalent to "0" and "90", respectively.  "180" and "270" are
  2216. supported only if `HPGL_VERSION' is "2" (the default).
  2217.  
  2218.    The drawing of visible white lines is supported only if
  2219. `HPGL_VERSION' is "2" and the environment variable `HPGL_OPAQUE_MODE'
  2220. is "yes" (the default).  If the value is "no" then white lines
  2221. (if any), which are normally drawn with pen #0, will not be drawn.
  2222. This feature is to accommodate older HP-GL/2 devices.  HP-GL/2 pen
  2223. plotters, for example, do not support the use of pen #0 to draw visible
  2224. white lines.  Some older HP-GL/2 devices may, in fact, malfunction if
  2225. asked to draw opaque objects.
  2226.  
  2227.    By default, `tek2plot -T hpgl' will draw with a fixed set of pens.
  2228. Which pens are present may be specified by setting the `HPGL_PENS'
  2229. environment variable.  If `HPGL_VERSION' is "1", the default value of
  2230. `HPGL_PENS' is "1=black"; if `HPGL_VERSION' is "1.5" or "2", the
  2231. default value of `HPGL_PENS' is
  2232. "1=black:2=red:3=green:4=yellow:5=blue:6=magenta:7=cyan".  The format
  2233. should be self-explanatory.  By setting `HPGL_PENS', you may specify a
  2234. color for any pen in the range #1...#31.  For information on what color
  2235. names are recognized, see *Note Color Names::.  Pen #1 must always be
  2236. present, though it need not be black. Any other pen in the range
  2237. #1...#31 may be omitted.
  2238.  
  2239.    If `HPGL_VERSION' is "2" then `tek2plot -T hpgl' will also be
  2240. affected by the environment variable `HPGL_ASSIGN_COLORS'.  If the
  2241. value of this variable is "yes", then `tek2plot -T hpgl' will not be
  2242. restricted to the palette specified in `HPGL_PENS': it will assign
  2243. colors to "logical pens" in the range #1...#31, as needed.  The default
  2244. value is "no" because other than color LaserJet printers and DesignJet
  2245. plotters, not many HP-GL/2 devices allow the assignment of colors to
  2246. logical pens.
  2247.  
  2248. 
  2249. File: plotutils.info,  Node: plotfont,  Next: spline,  Prev: tek2plot,  Up: Top
  2250.  
  2251. The `plotfont' Utility
  2252. **********************
  2253.  
  2254. * Menu:
  2255.  
  2256. * plotfont Examples::         How to use plotfont
  2257. * plotfont Invocation::       Command-line options
  2258. * plotfont Environment::      Environment variables
  2259.  
  2260. 
  2261. File: plotutils.info,  Node: plotfont Examples,  Next: plotfont Invocation,  Prev: plotfont,  Up: plotfont
  2262.  
  2263. How to use `plotfont'
  2264. =====================
  2265.  
  2266.    GNU `plotfont' is a simple utility that will produce a character map
  2267. for any font available to the GNU plotting utilities `graph', `plot',
  2268. and `tek2plot', and the GNU `libplot' graphics library on which they
  2269. are based.  The map may be displayed on an X Window System display, or
  2270. produced in any of five output formats.
  2271.  
  2272.    Which fonts are available depends on the choice of display or output
  2273. format.  To get a list of the available fonts, use the `--help-fonts'
  2274. option.  For example,
  2275.  
  2276.      plotfont -T ps --help-fonts
  2277.  
  2278. will list the fonts that are available when producing Postscript output.
  2279. One of these fonts is "Times-Roman".  Doing
  2280.  
  2281.      plotfont -T ps Times-Roman > map.ps
  2282.  
  2283. will produce a character map of the lower half of this font, which
  2284. consists of printable ASCII characters.  The map will be a 12x8 grid,
  2285. with a character centered in each grid cell.  If you include the `-2'
  2286. option, you will get a map of the upper half of the font.
  2287.  
  2288.    Most built-in fonts are ISO-Latin-1 fonts, which means that the upper
  2289. half is arranged according to the ISO-Latin-1 encoding.  The
  2290. "HersheyCyrillic" font is one that is not.  If you do
  2291.  
  2292.      plotfont -T ps -2 HersheyCyrillic > map.ps
  2293.  
  2294. you will get a map that illustrates its arrangment, which is called
  2295. KOI8-R.  The KOI8-R arrangement is the standard for Unix and networking
  2296. applications in the former Soviet Union.  So-called dingbats fonts, such
  2297. as "ZapfDingbats" and "Wingdings", also have an individualistic layout.
  2298. The Wingdings font is available when producing output in HP-GL or
  2299. HP-GL/2 format.  If you do
  2300.  
  2301.      plotfont -T hpgl Wingdings > map.plt
  2302.  
  2303. you will get a Wingdings character map, in HP-GL/2 format, that may be
  2304. imported into any application that understands HP-GL/2.  In most
  2305. installations of the plotting utilities, the Wingdings font is not
  2306. available when producing Postscript output.
  2307.  
  2308.    In all, 102 fonts that are built into the plotting utilities.  *Note
  2309. Text Fonts::.  If you are using the plotting utilities to display
  2310. output on an X display, you are not restricted to the built-in fonts.
  2311. Doing
  2312.  
  2313.      plotfont -T X --help-fonts
  2314.  
  2315. produces a list of the built-in fonts that are available, including both
  2316. Hershey and Postscript fonts.  But fonts available on your X display
  2317. may also be used.  The `xlsfonts' command will list the fonts available
  2318. on your X display, most font names being given in what is called XLFD
  2319. format.  The plotting utilities refer to X fonts by shortened versions
  2320. of their XLFD names.  For example, the font "Utopia-Regular" is
  2321. available on many X displays.  Its XLFD name is
  2322. "-adobe-utopia-medium-r-normal-0-0-0-0-p-0-iso8859-1", and its
  2323. shortened XLFD name is "utopia-medium-r-normal".  If you do
  2324.  
  2325.      plotfont -T X utopia-medium-r-normal
  2326.  
  2327. then a character map for this font will be displayed in a popped-up
  2328. X window.
  2329.  
  2330.    When using the `-T X' option, you may also use the `--bitmap-size'
  2331. option to choose the size of the popped-up window.  Modern X displays
  2332. can scale fonts by different amounts in the horizontal and vertical
  2333. directions.  If, for example, you add `--bitmap-size 600x300' to the
  2334. above command line, both the character map and the Utopia-Regular font
  2335. within it will be scaled in this way.  If your X display does not
  2336. support font scaling, a scalable font will be substituted.
  2337.  
  2338. 
  2339. File: plotutils.info,  Node: plotfont Invocation,  Next: plotfont Environment,  Prev: plotfont Examples,  Up: plotfont
  2340.  
  2341. `plotfont' command-line options
  2342. ===============================
  2343.  
  2344.    The `plotfont' font display utility will produce a character map for
  2345. any of the fonts available to the GNU plotting utilities `graph',
  2346. `plot', and `tek2plot', and the GNU `libplot' graphics library on which
  2347. they are based.  The map may be produced in any supported output
  2348. format, or displayed on an `X Window' System display.  The display type
  2349. or output format is specified with the `-T' option.
  2350.  
  2351.    The names of the fonts for which a character map will be produced may
  2352. appear anywhere on the `plotfont' command line.  That is, the relative
  2353. order of font names and command-line options does not matter.  The
  2354. possible options are listed below.  There are three sorts of option:
  2355.  
  2356.   1. General options.
  2357.  
  2358.   2. Options relevant only to raw `plotfont', i.e., relevant only if no
  2359.      display type or output format is specified with the `-T' option.
  2360.  
  2361.   3. Options requesting information (e.g., `--help').
  2362.  
  2363. Each option that takes an argument is followed, in parentheses, by the
  2364. type and default value of the argument.
  2365.  
  2366.    The following are general options.
  2367.  
  2368. `-1'
  2369. `--lower-half'
  2370.      Generate a character map for the lower half of each specified font.
  2371.      This is the default.
  2372.  
  2373. `-2'
  2374. `--upper-half'
  2375.      Generate a character map for the upper half of each specified font.
  2376.  
  2377. `-o'
  2378. `--octal'
  2379.      Number the characters in octal rather than in decimal (the
  2380.      default).
  2381.  
  2382. `-x'
  2383. `--hexadecimal'
  2384.      Number the characters in hexadecimal rather than in decimal (the
  2385.      default).
  2386.  
  2387. `--box'
  2388.      Surround each character with a box, showing its extent to left and
  2389.      right.  The default is not to do this.
  2390.  
  2391. `-J PAGE'
  2392. `--jis-page PAGE'
  2393.      Generate a character map for page PAGE of a Japanese font encoded
  2394.      according to JIS [Japanese Industrial Standard] X0208.  PAGE must
  2395.      be in the range 33...126.  This option may be used only with the
  2396.      HersheyEUC [Extended Unix Code] font.  If used, it overrides the
  2397.      `-1' and `-2' options.
  2398.  
  2399.      The JIS X0208 standard represents each encoded character as a pair
  2400.      of bytes: a page number and a character number, both in the range
  2401.      0x21...0x7e, i.e., 33...126.  The HersheyEUC font implements this
  2402.      standard, and further encodes each character by setting the high
  2403.      bit on each of the two bytes.
  2404.  
  2405.      In HersheyEUC, Japanese syllabic characters (Hiragana and
  2406.      Katakana) are located on pages 35 and 36.  Japanese ideograms
  2407.      (Kanji) are located on pages 48 and above.
  2408.  
  2409. `-T TYPE'
  2410. `--display-type TYPE'
  2411.      (String, default "meta".)  Select a display type or output format
  2412.      of TYPE, which may be one of the strings "X", "ps", "fig", "hpgl",
  2413.      "tek", and "meta".  These refer respectively to the
  2414.      X Window System, `idraw'-editable Postscript, the format used by
  2415.      the `xfig' drawing editor, the Hewlett-Packard Graphics Language,
  2416.      Tektronix format, and device-independent GNU metafile format.
  2417.  
  2418.      Files to be edited by `xfig' may contain only a single page of
  2419.      graphics.  So if the `-T fig' option is used, a character map will
  2420.      be produced for only the first-specified font.
  2421.  
  2422. `--bg-color NAME'
  2423.      (String, default "white".)  Set the color used for the background
  2424.      to be NAME.  This is currently relevant only to `plotfont -T X'.
  2425.      An unrecognized name sets the color to the default.  For
  2426.      information on what names are recognized, see *Note Color Names::.
  2427.      The environment variable `BG_COLOR' can equally well be used to
  2428.      specify the background color.
  2429.  
  2430. `--bitmap-size BITMAP_SIZE'
  2431.      (String, default "570x570".)  Set the size of the graphics display
  2432.      in which a character map is drawn, in terms of pixels, to be
  2433.      BITMAP_SIZE.  This is relevant only to `plot2font -T X', for which
  2434.      the graphics display is an X window.  If you choose a rectangular
  2435.      (non-square) window size, the font in the character map will be
  2436.      scaled anisotropically, i.e., by different factors in the
  2437.      horizontal and vertical direction.  This requires an X11R6
  2438.      display.  If the font cannot be scaled in this way, it will be
  2439.      replaced by a default scalable font, such as the Hershey vector
  2440.      font "HersheySerif".
  2441.  
  2442.      The environment variable `BITMAPSIZE' can equally well be used to
  2443.      specify the window size.  For backward compatibility, the
  2444.      X resource `Xplot.geometry', which can be set by the user, may be
  2445.      used instead.
  2446.  
  2447. `--numbering-font-name FONT_NAME'
  2448.      (String, default "Helvetica" except for `plotfont -T hpgl' and
  2449.      `plotfont -T tek', for which "HersheySerif" is the default.)  Set
  2450.      the font used for the numbering of the characters in the character
  2451.      map(s) to be FONT_NAME.
  2452.  
  2453. `--page-size PAGESIZE'
  2454.      (String, default "letter".) Set the size of the page for which the
  2455.      character map(s) will be produced.  This is relevant only to
  2456.      `plotfont -T ps', `plotfont -T fig', and `plotfont -T hpgl'.
  2457.      "letter" means an 8.5in by 11in page.  Any ISO page size in the
  2458.      range "a0"..."a4" or ANSI page size in the range "a"..."e" may be
  2459.      specified ("letter" is an alias for "a" and "tabloid" is an alias
  2460.      for "b").  "legal" and "ledger" are recognized page sizes also.
  2461.      The environment variable `PAGESIZE' can equally well be used to
  2462.      specify the page size.
  2463.  
  2464.      For `plotfont -T ps', the graphics display within which each
  2465.      character map is drawn will be a square region centered on the
  2466.      page, and occupying its full width.  For `plotfont -T fig', the
  2467.      graphics display will be a square region located in the upper left
  2468.      corner of an `xfig' display, with width equal to the width of the
  2469.      specified page.  For `plotfont -T hpgl', fine control over the
  2470.      positioning of the graphics display on the page can be
  2471.      accomplished by setting certain environment variables (*note
  2472.      plotfont Environment::.).
  2473.  
  2474. `--pen-color NAME'
  2475.      (String, default "black".)  Set the pen color to be NAME.  An
  2476.      unrecognized name sets the pen color to the default.  For
  2477.      information on what color names are recognized, see *Note Color
  2478.      Names::.
  2479.  
  2480. `--title-font-name FONT_NAME'
  2481.      (String) Set the font used for the title of each character map to
  2482.      be FONT_NAME.  Normally the font used for the title is the same as
  2483.      the font whose character set is being displayed.  This option is
  2484.      useful when producing character maps for unusual fonts such as
  2485.      "ZapfDingbats" and "Wingdings".
  2486.  
  2487.    The following option is relevant only to raw `plotfont', i.e.,
  2488. relevant only if no display type or output format is specified with the
  2489. `-T' option.  In this case `plotfont' outputs a graphics metafile,
  2490. which may be translated to other formats by invoking `plot'.
  2491.  
  2492. `-O'
  2493. `--portable-output'
  2494.      Output the portable (human-readable) version of GNU metafile
  2495.      format, rather than a binary version (the default).
  2496.  
  2497.    The following options request information.
  2498.  
  2499. `--help'
  2500.      Print a list of command-line options, and then exit.
  2501.  
  2502. `--help-fonts'
  2503.      Print a table of available fonts, and then exit.  The table will
  2504.      depend on which display type or output format is specified with
  2505.      the `-T' option.  `plotfont -T X', `plotfont -T ps', and `plotfont
  2506.      -T fig' each support the 35 standard Postscript fonts.  `plotfont
  2507.      -T hpgl' supports the 45 standard PCL 5 fonts.  All four, together
  2508.      with `plotfont -T hpgl', support a set of 22 Hershey vector fonts.
  2509.      Raw `plotfont' in principle supports any of these 102 fonts,
  2510.      since its output must be translated to other formats with `plot'.
  2511.  
  2512. `--list-fonts'
  2513.      Like `--help-fonts', but lists the fonts in a single column to
  2514.      facilitate piping to other programs.  If no display type or output
  2515.      format is specified with the `-T' option, the full set of supported
  2516.      fonts is listed.
  2517.  
  2518. `--version'
  2519.      Print the version number of `plotfont' and the plotting utilities
  2520.      package, and exit.
  2521.  
  2522. 
  2523. File: plotutils.info,  Node: plotfont Environment,  Prev: plotfont Invocation,  Up: plotfont
  2524.  
  2525. Environment variables
  2526. =====================
  2527.  
  2528.    The behavior of `plotfont' is affected by several environment
  2529. variables, which are the same as those that affect `graph', `plot', and
  2530. `tek2plot'.  For convenience, we list them here.
  2531.  
  2532.    We have already mentioned the environment variables `BITMAPSIZE',
  2533. `PAGESIZE', and `BG_COLOR'.  They serve as backups for the options
  2534. `--bitmap-size', `--page-size', and `--bg-color'.  The remaining
  2535. environment variables are specific to individual display devices.  They
  2536. control device driver parameters.
  2537.  
  2538.    `plotfont -T X', which pops up a window on an X Window System
  2539. display and draws a character map in it, checks the `DISPLAY'
  2540. environment variable.  The value of this variable determines the
  2541. display on which the window will be popped up.
  2542.  
  2543.    `plotfont -T hpgl', which produces Hewlett-Packard Graphics Language
  2544. output, is affected by several environment variables.  The most
  2545. important is `HPGL_VERSION', which may be set to "1", "1.5", or "2"
  2546. (the default).  "1" means that the output should be generic HP-GL,
  2547. "1.5" means that the output should be suitable for the HP7550A graphics
  2548. plotter and the HP758x, HP7595A and HP7596A drafting plotters (HP-GL
  2549. with some HP-GL/2 extensions), and "2" means that the output should be
  2550. modern HP-GL/2.  If the version is "1" or "1.5" then the only available
  2551. fonts will be vector fonts.
  2552.  
  2553.    The position of the `plotfont -T hpgl' character map on the page can
  2554. be adjusted by setting the `HPGL_XOFFSET' and `HPGL_YOFFSET'
  2555. environment variables, which may be specified in centimeters,
  2556. millimeters, or inches.  For example, an offset could be specified as
  2557. "2cm" or "1.2in".  Also, the map can be rotated 90 degrees
  2558. counterclockwise on the page by setting the `HPGL_ROTATE' environment
  2559. variable to "yes".  Besides "no" and "yes", recognized values for this
  2560. variable are "0", "90", "180", and "270".  "no" and "yes" are
  2561. equivalent to "0" and "90", respectively.  "180" and "270" are
  2562. supported only if `HPGL_VERSION' is "2" (the default).
  2563.  
  2564.    By default, `plotfont -T hpgl' will draw with a fixed set of pens.
  2565. Which pens are present may be specified by setting the `HPGL_PENS'
  2566. environment variable.  If `HPGL_VERSION' is "1", the default value of
  2567. `HPGL_PENS' is "1=black"; if `HPGL_VERSION' is "1.5" or "2", the
  2568. default value of `HPGL_PENS' is
  2569. "1=black:2=red:3=green:4=yellow:5=blue:6=magenta:7=cyan".  The format
  2570. should be self-explanatory.  By setting `HPGL_PENS', you may specify a
  2571. color for any pen in the range #1...#31.  For information on what color
  2572. names are recognized, see *Note Color Names::.  Pen #1 must always be
  2573. present, though it need not be black. Any other pen in the range
  2574. #1...#31 may be omitted.
  2575.  
  2576.    If `HPGL_VERSION' is "2" then `plotfont -T hpgl' will also be
  2577. affected by the environment variable `HPGL_ASSIGN_COLORS'.  If the
  2578. value of this variable is "yes", then `plotfont -T hpgl' will not be
  2579. restricted to the palette specified in `HPGL_PENS': it will assign
  2580. colors to "logical pens" in the range #1...#31, as needed.  The default
  2581. value is "no" because other than color LaserJet printers and DesignJet
  2582. plotters, not many HP-GL/2 devices allow the assignment of colors to
  2583. logical pens.
  2584.  
  2585.    `plotfont -T tek', which produces output for a Tektronix terminal or
  2586. emulator, checks the `TERM' environment variable.  If the value of
  2587. `TERM' is `xterm', `xterms', or `kterm', it is taken as a sign that the
  2588. current application is running in an X Window System VT100 terminal
  2589. emulator: an `xterm'.  Before drawing graphics, `plotfont -T tek' will
  2590. emit an escape sequence that causes the terminal emulator's auxiliary
  2591. Tektronix window, which is normally hidden, to pop up.  After the
  2592. graphics are drawn, an escape sequence that returns control to the
  2593. original VT100 window will be emitted.  The Tektronix window will
  2594. remain on the screen.
  2595.  
  2596.    If the value of `TERM' is `kermit', `ansi.sys', `ansissys',
  2597. `ansi.sysk', or `ansisysk', it is taken as a sign that the current
  2598. application is running in the VT100 terminal emulator provided by the
  2599. MS-DOS version of `kermit'.  Before drawing graphics, `plotfont -T tek'
  2600. will emit an escape sequence that switches the terminal emulator to
  2601. Tektronix mode.  Also, some of the Tektronix control codes emitted by
  2602. `plotfont -T tek' will be `kermit'-specific.  There will be a limited
  2603. amount of color support, which is not normally the case (the 16
  2604. `ansi.sys' colors will be supported).  After drawing graphics,
  2605. `plotfont -T tek' will emit an escape sequence that returns the
  2606. emulator to VT100 mode.  The key sequence `ALT minus' can be employed
  2607. manually within `kermit' to switch between the two modes.
  2608.  
  2609. 
  2610. File: plotutils.info,  Node: spline,  Next: ode,  Prev: plotfont,  Up: Top
  2611.  
  2612. The `spline' Program
  2613. ********************
  2614.  
  2615. * Menu:
  2616.  
  2617. * spline Examples::         How to use spline
  2618. * Advanced Use of spline::  More sophisticated uses
  2619. * spline Invocation::       Command-line options
  2620.  
  2621. 
  2622. File: plotutils.info,  Node: spline Examples,  Next: Advanced Use of spline,  Prev: spline,  Up: spline
  2623.  
  2624. How to use `spline'
  2625. ===================
  2626.  
  2627.    GNU `spline' is a program for interpolating between the data points
  2628. in one or more datasets.  Each dataset would consist of values for an
  2629. independent variable and a dependent variable, which may be a vector of
  2630. specified fixed length.  When discussing interpolation, we call these
  2631. variables `t' and `y', respectively.  To emphasize: t is a scalar, but
  2632. in general the dependent variable y may be a vector.
  2633.  
  2634.    The simplest case is when there is a single input file, which is in
  2635. ASCII format, and the vector y is one-dimensional.  This is the
  2636. default.  For example, the input file could contain the dataset
  2637.  
  2638.      0.0  0.0
  2639.      1.0  1.0
  2640.      2.0  0.0
  2641.  
  2642. which are the coordinates (t,y) of the data points (0,0), (1,1), and
  2643. (2,0).  Data points do not need to be on different lines, nor do the t
  2644. and y coordinates of a data point need to be on the same line.
  2645. However, there should be no blank lines in the input if it is to be
  2646. viewed as forming a single dataset.  Also, by default the t coordinate
  2647. should be monotonically increasing, so that y may be viewed as a
  2648. function of t.
  2649.  
  2650.    You would construct a spline (the graph of an `interpolating
  2651. function') passing through the points in this dataset by doing
  2652.  
  2653.      spline input_file > output_file
  2654.  
  2655. To produce a Postscript plot of the spline with the `graph' utility,
  2656. you would do
  2657.  
  2658.      spline input_file | graph -T ps > output.ps
  2659.  
  2660. To display a spline on an X Window System display, you could do
  2661.  
  2662.      echo 0 0 1 1 2 0 | spline | graph -T X
  2663.  
  2664. Notice that the last example avoids the use of the input file
  2665. altogether.  `spline' will read from standard input if no files are
  2666. specified on the command line, or if the special file name `-' is
  2667. specified.
  2668.  
  2669.    What exactly does `spline' do?  First, it fits a curve (the graph of
  2670. an interpolating function) through the points in the dataset.  Then it
  2671. splits the interval over which the independent variable t ranges into
  2672. 100 sub-intervals, and computes the y values at each of the 101
  2673. subdivision points.  It then outputs each of the pairs (t, y).  These
  2674. are the coordinates of 101 points that lie along a curve that
  2675. interpolates between the points in the dataset.  If there is more than
  2676. one dataset in the input (separated by blank lines), each dataset is
  2677. interpolated separately.
  2678.  
  2679.    You may use the `-n' option to replace `100' by any other integer.
  2680. You may also use the `-t' option to specify an interpolation interval
  2681. that differs from the default (the interval over which the independent
  2682. variable ranges).  For example, the command
  2683.  
  2684.      echo 0 0 1 1 2 0 | spline -n 20 -t 1.0 1.5 > output_file
  2685.  
  2686. will produce a dataset consisting of 21 (rather than 101) data points,
  2687. with t values spaced regularly between 1.0 and 1.5 (rather than between
  2688. 0.0 and 2.0).  The data points will lie along a curve passing through
  2689. (0,0), (1,1), and (2,0).  This curve will be a parabola.
  2690.  
  2691.    In general, the interpolating function will be a piecewise cubic
  2692. spline.  That is, between each pair of adjacent `knots' (points in the
  2693. input dataset), y will be a cubic function of t.  This function will
  2694. differ, depending on which pair of knots y lies between.  At each knot,
  2695. both the slope and curvature of the cubic pieces to either side will
  2696. match.  In mathematical terms, the interpolating curve will be twice
  2697. continuously differentiable.
  2698.  
  2699.    `spline' supports `adding tension' to the interpolating curve.
  2700. A nonzero value for the tension can be specified with the `-T' option.
  2701. For example, a spline under considerable tension can be computed and
  2702. displayed by doing
  2703.  
  2704.      echo 0 0 1 0 2 0 | spline -T 10 | graph -T X
  2705.  
  2706. As the tension parameter is increased to positive infinity, the spline
  2707. will converge to a polygonal line.  You are meant to think of the spline
  2708. as being drawn taut.  Actually, tension may be negative as well as
  2709. positive.  A spline with negative tension will tend to bow outward,
  2710. in fact to oscillate sinusoidally.  But as the tension decreases to
  2711. negative infinity, the spline, though oscillatory, will again converge
  2712. to a polygonal line.
  2713.  
  2714.    If the tension is positive, its reciprocal will be the maximum range
  2715. of the independent variable t over which the spline will `like to
  2716. curve'.  Increasing the tension far above zero will accordingly force
  2717. the spline to consist of short curved sections, centered on the data
  2718. points, and sections that are almost straight.  It follows that tension
  2719. is a `dimensionful' quantity.  If the tension is nonzero, then when the
  2720. values of the independent variable are multiplied by some common
  2721. positive factor, the tension should be divided by the same factor to
  2722. obtain a scaled version of the original spline.  If the tension is zero
  2723. (the default, or cubic spline case), then the computation of the spline
  2724. will be unaffected by linear scaling of the data.
  2725.  
  2726.    In mathematical terms, a spline under tension will satisfy the
  2727. differential equation y""=sgn(tension)*(tension^2)y" between each
  2728. successive pair of knots.  If the tension equals zero, which is the
  2729. default, the fourth derivative of y with respect to t will equal zero
  2730. at every point.  In this case, y as a function of t will reduce to a
  2731. cubic polynomial between each successive pair of knots.  But if the
  2732. tension is nonzero, y will not be a polynomial function of t.  It may
  2733. be expressed in terms of exponential functions, however.
  2734.  
  2735.    Irrespective of whether or not the spline is under tension, you may
  2736. specify the `-p' option if you wish the spline to be a periodic
  2737. function of t.  This will only work if the y values for the first and
  2738. last points in the dataset are equal.  Otherwise, it would make no
  2739. sense to compute a periodic interpolation.
  2740.  
  2741.    It is sometimes useful to interpolate between data points at the same
  2742. time as they are generated by an auxiliary program.  That is, it is
  2743. useful for `spline' to function as a real-time filter.  `spline' does
  2744. not normally act as a filter, since computing an interpolating curve
  2745. that is as smooth as possible is a global task.  But if the `-f' option
  2746. is specified, `spline' will indeed function as a filter.  A different
  2747. interpolation algorithm (cubic Bessel interpolation, which is local
  2748. rather than global) will be used.  If `-f' is specified, `-p' may not
  2749. be specified.  Also, if `-f' is specified then an interpolation
  2750. interval (a range of t values) must be requested explicitly with the
  2751. `-t' option.
  2752.  
  2753.    Cubic Bessel interpolation is inherently less smooth than the
  2754. construction of a global cubic spline.  If the `-f' option is
  2755. specified, the slope of the spline at each knot will be chosen by
  2756. fitting a parabola through that knot, and the two adjacent knots.  The
  2757. slopes of the two interpolating segments to either side of each interior
  2758. knot will match at that knot, but typically their curvatures will not.
  2759. In mathematical terms, the interpolating curve will be continuously
  2760. differentiable, but in general not twice continuously differentiable.
  2761. This loss of differentiability is the price that is paid for functioning
  2762. as a real-time filter.
  2763.  
  2764. 
  2765. File: plotutils.info,  Node: Advanced Use of spline,  Next: spline Invocation,  Prev: spline Examples,  Up: spline
  2766.  
  2767. Advanced use of `spline'
  2768. ========================
  2769.  
  2770.    The preceding section explains how `spline' can be employed to
  2771. interpolate a function y of a scalar variable t, in the case when y is
  2772. a scalar.  In this section we explain how to perform more sophisticated
  2773. interpolations.  This includes multidimensional interpolations, and
  2774. interpolations that are splinings of curves, rather than of functions.
  2775.  
  2776.    `spline' can handle the case when y is a vector of arbitrary
  2777. specified dimensionality.  The dimension can be specified with the `-d'
  2778. option.  For example, an input file could contain the multidimensional
  2779. dataset
  2780.  
  2781.      0.0  0.0  1.0
  2782.      1.0  1.0  0.0
  2783.      2.0  0.0  1.0
  2784.  
  2785. which are the coordinates (t,y) of the data points (0,0,1), (1,1,0),
  2786. and (2,0,1).  You would construct a spline (the graph of an
  2787. interpolating function) passing through the points in this dataset by
  2788. doing
  2789.  
  2790.      spline -d 2 input_file > output_file
  2791.  
  2792. The option `-d 2' is used because in this example, the dependent
  2793. variable y is a two-dimensional vector.  Each of the components of y
  2794. will be interpolated independently, and the output file will contain
  2795. points that lie along the graph of the resulting interpolating function.
  2796.  
  2797.    When doing multidimensional splining, you may use any of the options
  2798. that apply in the default one-dimensional case.  For example, the `-f'
  2799. option will yield real-time cubic Bessel interpolation.  As in the
  2800. one-dimensional case, if the `-f' option is used then the `-t' option
  2801. must be used as well, to specify an interpolation interval (a range of
  2802. t values).  The `-p' option will yield a periodic spline, i.e., the
  2803. graph of a periodic vector-valued function.  For this, the first and
  2804. last dataset y values must be the same.
  2805.  
  2806.    `spline' can also be used to draw a curve through arbitrarily chosen
  2807. points in the plane, or in general through arbitrarily chosen points in
  2808. d-dimensional space.  This is not the same as splining, at least as the
  2809. term is conventionally defined.  The reason is that `splining' refers
  2810. to construction of a function, rather than the construction of a curve
  2811. that may or may not be the graph of a function.  Not every curve is the
  2812. graph of a function.
  2813.  
  2814.    The following example shows how you may `spline a curve'.  The
  2815. command
  2816.  
  2817.      echo 0 0 1 0 1 1 0 1 | spline -d 2 -a -s | graph -T X
  2818.  
  2819. will construct a curve in the plane through the four points (0,0),
  2820. (1,0), (1,1), and (0,1), and graph it on an X Window System display.
  2821. The `-d 2' option specifies that the dependent variable y is
  2822. two-dimensional.  The `-a' option specifies that t values are missing
  2823. from the input, and should be automatically generated.  By default, the
  2824. first t value is 0, the second is 1, etc.  The `-s' option specifies
  2825. that the t values should be stripped from the output.
  2826.  
  2827.    The same technique may be used to spline a closed curve.  For
  2828. example, doing
  2829.  
  2830.      echo 0 0 1 0 0 1 0 0 | spline -d 2 -a -s -p | graph -T X
  2831.  
  2832. will construct and graph a closed, lozenge-shaped curve through the
  2833. three points (0,0), (1,0), and (0,1).  The construction of a closed
  2834. curve is guaranteed by the `-p' (i.e., `--periodic') option, and by the
  2835. repetition of the initial point (0,0) at the end of the sequence.
  2836.  
  2837.    When splining a curve, whether open or closed, you may wish to
  2838. substitute the `-A' option for the `-a' option.  Like the `-a' option,
  2839. the `-A' option specifies that t values are missing from the input and
  2840. should be automatically generated.  However, the first t value will be
  2841. zero, and the increment from one t value to the next will be the
  2842. distance between the corresponding values of y.  This scheme for
  2843. generating t values, when constructing a curve through a sequence of
  2844. points, is the scheme that is used in the well known FITPACK subroutine
  2845. library.  It is probably the best approach when the distances between
  2846. successive points fluctuate considerably.
  2847.  
  2848.    A curve through a sequence of points in the plane, whether open or
  2849. closed, may cross itself.  Some interesting visual effects can be
  2850. obtained by adding negative tension to such a curve.  For example, doing
  2851.  
  2852.      echo 0 0 1 0 1 1 0 0 | spline -d 2 -a -s -p -T -14 -n 500 | graph -T X
  2853.  
  2854. will construct a closed curve through the three points (0,0), (1,0),
  2855. and (0,1), which is wound into curlicues.  The `-n 500' option is
  2856. included because there are so many windings.  It specifies that 501
  2857. points should be generated, which is enough to draw a smooth curve.
  2858.  
  2859. 
  2860. File: plotutils.info,  Node: spline Invocation,  Prev: Advanced Use of spline,  Up: spline
  2861.  
  2862. `spline' command-line options
  2863. =============================
  2864.  
  2865. The `spline' program will interpolate vector-valued functions of a
  2866. scalar variable t, and curves in d-dimensional space.  The algorithms
  2867. used by `spline' are similar to those discussed in D. Kincaid and
  2868. [E.] W. Cheney, `Numerical Analysis' (2nd ed., Brooks/Cole, 1996),
  2869. section 6.4, and C. de Boor, `A Practical Guide to Splines'
  2870. (Springer-Verlag, 1978), Chapter 4.
  2871.  
  2872.    Input file names may be specified anywhere on the command line.  That
  2873. is, the relative order of font names and command-line options does not
  2874. matter.  If no file names are specified, or the file name `-' is
  2875. specified, the standard input is read.
  2876.  
  2877.    An input file may contain more than a single dataset.  Unless the
  2878. `-a' or `-A' options are used (see below), each dataset is expected to
  2879. consist of a sequence of data points, given as alternating t and y
  2880. values.  t is the scalar independent variable, and y is the
  2881. vector-valued dependent variable.  The dimensionality of y is specified
  2882. with the `-d' option (the default is 1).
  2883.  
  2884.    If the input file is in ASCII format (the default), its datasets are
  2885. separated by blank lines.  An input file may also contain any number of
  2886. comment lines, which must begin with the comment character `#'.
  2887. Comment lines are ignored.  They are not treated as blank, i.e., they do
  2888. not interrupt a dataset in progress.
  2889.  
  2890.    The options to `spline' are listed below.  There are three sorts of
  2891. option:
  2892.  
  2893.   1. Options specifying the type of interpolation to be performed on
  2894.      each dataset.
  2895.  
  2896.   2. Options specifying the input or output format.
  2897.  
  2898.   3. Options requesting information (e.g., `--help').
  2899.  
  2900. Options that take an argument are followed, in parentheses, by the type
  2901. and default value of the argument.
  2902.  
  2903.    The following options specify the type of interpolation to be
  2904. performed on each dataset.
  2905.  
  2906. `-f'
  2907. `--filter'
  2908.      Use a local interpolation algorithm (the cubic Bessel algorithm),
  2909.      so that `spline' can be used as a real-time filter.  The slope of
  2910.      the interpolating curve at each point in a dataset will be chosen
  2911.      by fitting a quadratic function through that point and the two
  2912.      adjacent points in the dataset.  If `-f' is specified then the
  2913.      `-t' option, otherwise optional, must be used as well.  Also, if
  2914.      `-f' is specified then the `-k', `-p', and `-T' options may not be
  2915.      used.
  2916.  
  2917.      If `-f' is *not* specified, then a different (global)
  2918.      interpolation algorithm will be used.
  2919.  
  2920. `-k K'
  2921. `--boundary-condition K'
  2922.      (Float, default 1.0.) Set the boundary condition parameter for each
  2923.      constructed spline to be K.  In each of its components, the spline
  2924.      will satisfy the two boundary conditions y"[0]=ky"[1] and
  2925.      y"[n]=ky"[n-1].  Here y[0] and y[1] signify the values of a
  2926.      specified component of the vector-valued dependent variable y at
  2927.      the first two points of a dataset, and y[n-1] and y[n] the values
  2928.      at the last two points.  Setting K to zero will yield a `natural'
  2929.      spline, i.e., one that has zero curvature at the two ends of the
  2930.      dataset.  The `-k' option may not be used if `-f' or `-p' is
  2931.      specified.
  2932.  
  2933. `-n N'
  2934. `--number-of-intervals N'
  2935.      (Integer, default 100.)  Subdivide the interval over which
  2936.      interpolation occurs into N subintervals.  The number of data
  2937.      points computed, and written to the output, will be n+1.
  2938.  
  2939. `-p'
  2940. `--periodic'
  2941.      Construct a periodic spline.  If this option is specified, the y
  2942.      values for the first and last points in each dataset must be
  2943.      equal.  The `-f' and `-k' options may not be used if `-p' is
  2944.      specified.
  2945.  
  2946. `-T TENSION'
  2947. `--tension TENSION'
  2948.      (Float, default 0.0.) Set the tension in each interpolating spline
  2949.      to be TENSION.  Between each pair of successive points in a
  2950.      dataset, the constructed spline will satisfy the differential
  2951.      equation y""=sgn(tension)*(tension^2)y" in each of its components.
  2952.      If TENSION equals zero, the spline will be piecewise cubic.  As
  2953.      TENSION increases to positive infinity, the spline will converge
  2954.      to a polygonal line.  The `-T' option may not be used if `-f' is
  2955.      specified.
  2956.  
  2957. `-t TMIN TMAX [TSPACING]'
  2958. `--t-limits TMIN TMAX [TSPACING]'
  2959.      For each dataset, set the interval over which interpolation occurs
  2960.      to be the interval between TMIN and TMAX.  If TSPACING is not
  2961.      specified, the interval will be divided into the number of
  2962.      subintervals specified by the `-n' option.  If the `-t' option is
  2963.      not used, the interval over which interpolation occurs will be the
  2964.      entire range of the independent variable in the dataset.  The `-t'
  2965.      option must always be used if the `-f' option is used to request
  2966.      filter-like behavior (see above).
  2967.  
  2968. The following options specify the format of the input file(s) and the
  2969. output file.
  2970.  
  2971. `-d DIMENSION'
  2972. `--y-dimension DIMENSION'
  2973.      (Integer, default 1.)  Set the dimensionality of the dependent
  2974.      variable y in the input and output files to be DIMENSION.
  2975.  
  2976. `-I DATA-FORMAT'
  2977. `--input-format DATA-FORMAT'
  2978.      (Character, default `a'.)  Set the data format for the input
  2979.      file(s) to be DATA-FORMAT.  The possible data formats are as
  2980.      follows.
  2981.  
  2982.     `a'
  2983.           ASCII format.  Each file is a sequence of floating point
  2984.           numbers, interpreted as the t and y coordinates of the
  2985.           successive data points in a dataset.  If y is d-dimensional,
  2986.           there will be d+1 numbers for each point.  The t and y
  2987.           coordinates of a point need not appear on the same line, and
  2988.           points need not appear on different lines.  But if a blank
  2989.           line occurs (i.e., two newlines in succession are seen), it is
  2990.           interpreted as the end of a dataset, and the beginning of the
  2991.           next.
  2992.  
  2993.     `f'
  2994.           Single precision binary format.  Each file is a sequence of
  2995.           floating point numbers, interpreted as the t and y coordinates
  2996.           of the successive data points in a dataset.  If y is
  2997.           d-dimensional, there will be d+1 numbers for each point.
  2998.           Successive datasets are separated by a single occurrence of
  2999.           the quantity `FLT_MAX', which is the largest possible single
  3000.           precision floating point number.  On most machines this is
  3001.           approximately 3.4x10^38.
  3002.  
  3003.     `d'
  3004.           Double precision binary format.  Each file is a sequence of
  3005.           double precision floating point numbers, interpreted as the t
  3006.           and y coordinates of the successive data points in a dataset.
  3007.           If y is d-dimensional, there will be d+1 numbers for each
  3008.           point.  Successive datasets are separated by a single
  3009.           occurrence of the quantity `DBL_MAX', which is the largest
  3010.           possible double precision floating point number.  On most
  3011.           machines this is approximately 1.8x10^308.
  3012.  
  3013.     `i'
  3014.           Integer binary format.  Each file is a sequence of integers,
  3015.           interpreted as the t and y coordinates of the successive data
  3016.           points in a dataset.  If y is d-dimensional, there will be
  3017.           d+1 numbers for each point.  Successive datasets are
  3018.           separated by a single occurrence of the quantity `INT_MAX',
  3019.           which is the largest possible integer.  On most machines this
  3020.           is 2^31-1.
  3021.  
  3022. `-a [STEP_SIZE [LOWER_LIMIT]]'
  3023. `--auto-abscissa [STEP_SIZE [LOWER_LIMIT]]'
  3024.      (Floats, defaults 1.0 and 0.0.)  Automatically generate values for
  3025.      the independent variable (t).  Irrespective of data format (`a',
  3026.      `f', `d', or `i'), this option specifies that the values of the
  3027.      independent variable (t) are missing from the input file: the
  3028.      dataset(s) to be read contain only values of the dependent
  3029.      variable (y), so that if y is d-dimensional, there will be only
  3030.      d numbers for each point.  The increment from each t value to the
  3031.      next will be STEP_SIZE, and the first t value will be LOWER_LIMIT.
  3032.  
  3033. `-A'
  3034. `--auto-dist-abscissa'
  3035.      Automatically generate values for the independent variable (t).
  3036.      This is a variant form of the `-a' option.  The increment from
  3037.      each t value to the next will be the distance between the
  3038.      corresponding y values, and the first t value will be 0.0.  This
  3039.      option is useful when interpolating curves rather than functions
  3040.      (*note Advanced Use of spline::.).
  3041.  
  3042. `-O DATA-FORMAT'
  3043. `--output-format DATA-FORMAT'
  3044.      (Character, default `a'.)  Set the data format for the output file
  3045.      to be DATA-FORMAT.  The interpretation of the DATA-FORMAT argument
  3046.      is the same as for the `-I' option.
  3047.  
  3048. `-P SIGNIFICANT-DIGITS'
  3049. `--precision SIGNIFICANT-DIGITS'
  3050.      (Integer, default 6.)  Set the numerical precision for the t and y
  3051.      values in the output file to be SIGNIFICANT-DIGITS.  This takes
  3052.      effect only if the output file is written in `a' format, i.e., in
  3053.      ASCII.
  3054.  
  3055. `-s'
  3056. `--suppress-abscissa'
  3057.      Omit the independent variable t from the output file; for each
  3058.      point, supply only the dependent variable y.  If y is
  3059.      d-dimensional, there will be only d numbers for each point,
  3060.      not d+1.  This option is useful when interpolating curves rather
  3061.      than functions (*note Advanced Use of spline::.).
  3062.  
  3063. The following options request information.
  3064.  
  3065. `--help'
  3066.      Print a list of command-line options, and then exit.
  3067.  
  3068. `--version'
  3069.      Print the version number of `spline' and the plotting utilities
  3070.      package, and exit.
  3071.  
  3072. 
  3073. File: plotutils.info,  Node: ode,  Next: libplot,  Prev: spline,  Up: Top
  3074.  
  3075. The `ode' Program
  3076. *****************
  3077.  
  3078.    The GNU `ode' utility can produce a numerical solution to the
  3079. initial value problem for many systems of first-order ordinary
  3080. differential equations (ODE's).  `ode' can also be used to solve
  3081. systems of higher-order ODE's, since a simple procedure converts an
  3082. n'th-order equation into n first-order equations.  The output of `ode'
  3083. can easily be piped to `graph', so that one or more solution curves may
  3084. be plotted as they are generated.
  3085.  
  3086.    Three distinct schemes for numerical solution are implemented:
  3087. Runge-Kutta-Fehlberg (the default), Adams-Moulton, and Euler.  The
  3088. Runge-Kutta-Fehlberg and Adams-Moulton schemes are available with
  3089. adaptive stepsize.
  3090.  
  3091. * Menu:
  3092.  
  3093. * Basic Math::                  Ordinary differential equations
  3094. * Simple ode Examples::         Simple examples using ode
  3095. * Additional ode Examples::     Additional examples using ode
  3096. * ode Invocation::              ode command-line options
  3097. * Diagnostics::                 Diagnostic messages
  3098. * Numerical Error::             Numerical error and how to avoid it
  3099. * Running Time::                Time spent running ode
  3100. * Input Language::              The ode input language formally specified
  3101. * ODE Bibliography::            Bibliography on ode and ODE's
  3102.  
  3103. 
  3104. File: plotutils.info,  Node: Basic Math,  Next: Simple ode Examples,  Prev: ode,  Up: ode
  3105.  
  3106. Mathematical basics
  3107. ===================
  3108.  
  3109.    We begin with some standard definitions.  A *differential equation*
  3110. is an equation involving an unknown function and its derivatives.
  3111. A differential equation is *ordinary* if the unknown function depends
  3112. on only one independent variable, often denoted t.  The *order* of the
  3113. differential equation is the order of the highest-order derivative in
  3114. the equation.  One speaks of a family, or *system* of equations when
  3115. more than one equation is involved.  If the equations are dependent on
  3116. one another, they are said to be *coupled*.  A *solution* is any
  3117. function satisfying the equations.  An *initial value problem* is
  3118. present when there exist subsidiary conditions on the unknown function
  3119. and its derivatives, all of which are given at the same value of the
  3120. independent variable.  In principle, such an `initial condition'
  3121. specifies a unique solution.  Questions about the existence and
  3122. uniqueness of a solution, along with further terminology, are discussed
  3123. in any introductory text.  (See Chapter 1 of Birkhoff and Rota's
  3124. `Ordinary Differential Equations'.  For this and other references
  3125. relevant to `ode', see *Note ODE Bibliography::.)
  3126.  
  3127.    In practical problems, the solution of a differential equation is
  3128. usually not expressible in terms of elementary functions.  Hence the
  3129. need for a numerical solution.
  3130.  
  3131.    A numerical scheme for solving an initial value problem produces an
  3132. approximate solution, using only functional evaluations and the
  3133. operations of arithmetic.  `ode' solves first-order initial value
  3134. problems of the form:
  3135.  
  3136.      x' = f(t,x,y,...,z)
  3137.      y' = g(t,x,y,...,z)
  3138.         .
  3139.         .
  3140.         .
  3141.      z' = h(t,x,y,...,z)
  3142.  
  3143. given the initial values for each dependent variable at the initial
  3144. value of the independent variable t, i.e.,
  3145.  
  3146.      x(a) = b
  3147.      y(a) = c
  3148.           .
  3149.           .
  3150.           .
  3151.      z(a) = d
  3152.      t = a
  3153.  
  3154. where a,b,c,...,d are constants.
  3155.  
  3156.    For `ode' to be able to solve such a problem numerically, the
  3157. functions f,g,...,h must be expressed, using the usual operators (+, -,
  3158. *, /, and ^), in terms of certain basic functions that `ode'
  3159. recognizes.  These are the same functions that the plotting program
  3160. `gnuplot' recognizes.  Moreover, each of f,g,...,h must be given
  3161. explicitly.  `ode' cannot deal with a system in which one or more of
  3162. the first derivatives is defined implicitly rather than explicitly.
  3163.  
  3164.    All schemes for numerical solution involve the calculation of an
  3165. approximate solution at discrete values of the independent variable t,
  3166. where the `stepsize' (the difference between any two successive values
  3167. of t, usually denoted h) may be constant or chosen adaptively.
  3168. In general, as the stepsize decreases the solution becomes more
  3169. accurate.  In `ode', the stepsize can be adjusted by the user.
  3170.  
  3171. 
  3172. File: plotutils.info,  Node: Simple ode Examples,  Next: Additional ode Examples,  Prev: Basic Math,  Up: ode
  3173.  
  3174. Simple examples using `ode'
  3175. ===========================
  3176.  
  3177.    The following examples should illustrate the procedure of stating an
  3178. initial value problem and solving it with `ode'.  If these examples are
  3179. too elementary, see *Note Input Language::, for a formal specification
  3180. of the `ode' input language.  There is also a directory containing
  3181. examples of `ode' input, which is distributed along with the GNU
  3182. plotting utilities.  On most systems it is installed as
  3183. `/usr/share/ode' or `/usr/local/share/ode'.
  3184.  
  3185.    Our first example is a simple one, namely
  3186.  
  3187.      y'(t) = y(t)
  3188.  
  3189. with the initial condition
  3190.  
  3191.      y(0) = 1
  3192.  
  3193. The solution to this differential equation is
  3194.  
  3195.      y(t) = e^t.
  3196.  
  3197. In particular
  3198.  
  3199.      y(1) = e^1 = 2.718282
  3200.  
  3201. to seven digits of accuracy.
  3202.  
  3203.    You may obtain this result with the aid of `ode' by typing on the
  3204. command line the sequence of commands
  3205.  
  3206.      ode
  3207.      y' = y
  3208.      y = 1
  3209.      print t, y
  3210.      step 0, 1
  3211.  
  3212. Two columns of numbers will appear.  Each line will show the value of
  3213. the independent variable t, and the value of the variable y, as t is
  3214. `stepped' from 0 to 1.  The last line will be
  3215.  
  3216.      1 2.718282
  3217.  
  3218. as expected.  You may use the `-p' option to change the precision.  If,
  3219. for example, you type `ode -p 10' rather than `ode', you will get ten
  3220. digits of accuracy in the output, rather than seven (the default).
  3221.  
  3222.    After the above output, `ode' will wait for further instructions.
  3223. Entering for example the line
  3224.  
  3225.      step 1, 0
  3226.  
  3227. should yield two more columns of numbers, containing the values of t
  3228. and y that are computed when t is stepped back from 1 to 0.  You could
  3229. type instead
  3230.  
  3231.      step 1, 2
  3232.  
  3233. to increase rather than decrease t.  To exit `ode', you would type a
  3234. line containing only `.', i.e. a single period, and tap `return'.
  3235. `ode' will also exit if it sees an end-of-file indicator in its input
  3236. stream, which you may send from your terminal by typing control-D.
  3237.  
  3238.    Each line of the preceding example should be self-explanatory.
  3239. A `step' statement sets the beginning and the end of an interval over
  3240. which the independent variable (here, t) will range, and causes `ode'
  3241. to set the numerical scheme in motion.  The initial value appearing in
  3242. the first `step' statement (i.e., 0) and the assignment statement
  3243.  
  3244.      y = 1
  3245.  
  3246. are equivalent to the initial condition y(0) = 1.  The statements
  3247. `y' = y' and `y = 1' are very different: `y' = y' defines a way of
  3248. computing the derivative of y, while `y = 1' sets the initial value
  3249. of y.  Whenever a `step' statement is encountered, `ode' tries to step
  3250. the independent variable through the interval it specifies.  Which
  3251. values are to be printed at each step is specified by the most recent
  3252. `print' statement.  For example,
  3253.  
  3254.      print t, y, y'
  3255.  
  3256. would cause the current value of the independent variable t, the
  3257. variable y, and its derivative to be printed at each step.
  3258.  
  3259.    To illustrate `ode''s ability to take its input or the initial part
  3260. of its input from a file, you could prepare a file containing the
  3261. following lines:
  3262.  
  3263.      # an ode to Euler
  3264.      y  = 1
  3265.      y' = y
  3266.      print t, y, y'
  3267.  
  3268. Call this file `euler'.  (The `#' line is a comment line, which may
  3269. appear at any point.  Everything from the `#' to the end of the line on
  3270. which it appears will be ignored.)  To process this file with `ode',
  3271. you could type on your terminal
  3272.  
  3273.      ode -f euler
  3274.      step 0, 1
  3275.  
  3276. These two lines cause `ode' to read the file `euler', and the stepping
  3277. to take place.  You will now get three quantities (t, y, and y')
  3278. printed at each of the values of t between 0 and 1.  At the conclusion
  3279. of the stepping, `ode' will wait for any further commands to be input
  3280. from the terminal.  This example illustrates that
  3281.  
  3282.      ode -f euler
  3283.  
  3284. is not equivalent to
  3285.  
  3286.      ode < euler
  3287.  
  3288. The latter would cause `ode' to take all its input from the file
  3289. `euler', while the former allows subsequent input from the terminal.
  3290. For the latter to produce output, you would need to include a `step'
  3291. line at the end of the file.  You would not need to include a `.' line,
  3292. however.  `.' is used to terminate input only when input is being read
  3293. from a terminal.
  3294.  
  3295.    A second simple example involves the numerical solution of a
  3296. second-order differential equation.  Consider the initial value problem
  3297.  
  3298.      y''(t) = -y(t)
  3299.      y(0) = 0
  3300.      y'(0) = 1
  3301.  
  3302. Its solution would be
  3303.  
  3304.      y(t) = sin(t)
  3305.  
  3306. To solve this problem using `ode', you must express this second-order
  3307. equation as two first-order equations.  Toward this end you would
  3308. introduce a new function, called yp say, of the independent variable t.
  3309. The pair of equations
  3310.  
  3311.      y' = yp
  3312.      yp' = -y
  3313.  
  3314. would be equivalent to the single equation above.  This sort of
  3315. reduction of an n'th order problem to n first order problems is a
  3316. standard technique.
  3317.  
  3318.    To plot the variable y as a function of the variable t, you could
  3319. create a file containing the lines
  3320.  
  3321.      # sine : y''(t) = -y(t), y(0) = 0, y'(0) = 1
  3322.      sine' = cosine
  3323.      cosine' = -sine
  3324.      sine = 0
  3325.      cosine = 1
  3326.      print t, sine
  3327.  
  3328. (y and yp have been renamed sine and cosine, since that is what they
  3329. will be.)  Call this file `sine'.  To display the generated data points
  3330. on an X Window System display as they are generated, you would type
  3331.  
  3332.      ode -f sine | graph -T X -x 0 10 -y -1 1
  3333.      step 0, 2*PI
  3334.      .
  3335.  
  3336. After you type the `ode' line, `graph -T X' will pop up a window, and
  3337. after you type the `step' line, the generated dataset will be drawn
  3338. in it.  The `-x 0 10' and `-y -1 1' options, which set the bounds for
  3339. the two axes, are necessary if you wish to display points in real time:
  3340. as they are generated.  If the axis bounds were not specified on the
  3341. command line, `graph -T X' would wait until all points are read from
  3342. the input before determining the bounds, and drawing the plot.
  3343.  
  3344.    A slight modification of this example, showing how `ode' can
  3345. generate several datasets in succession and plot them on the same graph,
  3346. would be the following.  Suppose that you type on your terminal the
  3347. following lines.
  3348.  
  3349.      ode -f sine | graph -T X -C -x 0 10 -y -1 1
  3350.      step 0, PI
  3351.      step PI, 2*PI
  3352.      step 2*PI, 3*PI
  3353.      .
  3354.  
  3355. Then the sine curve will be traced out in three stages.  Since the
  3356. output from each `step' statement ends with a blank line, `graph -T X'
  3357. will treat each section of the sine curve as a different dataset.  If
  3358. you are using a color display, each of the three sections will be
  3359. plotted in a different color.  This is a feature provided by `graph',
  3360. which normally changes its linemode after each dataset it reads.  If
  3361. you do not like this feature, you may turn it off by using `graph -T X
  3362. -B' instead of `graph -T X'.
  3363.  
  3364.    In the above examples, you could use any of the other variants of
  3365. `graph' instead of `graph -T X'.  For example, you could use `graph -T
  3366. ps' to obtain a plot in encapsulated Postscript format, by typing
  3367.  
  3368.      ode -f sine | graph -T ps > plot.ps
  3369.      step 0, 2*PI
  3370.      .
  3371.  
  3372. You should note that of the six variants of `graph', `graph -T ps',
  3373. `graph -T fig', and `graph -T hpgl' do not produce output in real time,
  3374. even when the axis bounds are specified with the `-x' and `-y' options.
  3375. So if `graph -T ps', `graph -T fig', or `graph -T hpgl' is used, the
  3376. plot will be produced only when input from `ode' is terminated, which
  3377. will occur when you type `.'.
  3378.  
  3379.    In the preceding examples, the derivatives of the dependent variables
  3380. were specified by comparatively simple expressions.  They are allowed to
  3381. be arbitrarily complicated functions of the dependent variables and the
  3382. independent variable.  They may also involve any of the functions that
  3383. are built into `ode'.  `ode' has a fair number of functions built in,
  3384. including abs, sqrt, exp, log, log10, sin, cos, tan, asin, acos, atan,
  3385. sinh, cosh, tanh, asinh, acosh, and atanh.  Less familiar functions
  3386. which are built into it are besj0, besj1, besy0, besy1, erf, erfc,
  3387. inverf, lgamma, gamma, norm, invnorm, ibeta, and igamma.  These have
  3388. the same definitions as in the plotting program `gnuplot'.  (All
  3389. functions take a single argument, except for ibeta, which takes three,
  3390. and igamma, which takes two).  `ode' also knows the meaning of the
  3391. constant `PI', as the above examples show.  The names of the preceding
  3392. functions are reserved, so, e.g., `cos' and `sin' may not be used as
  3393. names for variables.
  3394.  
  3395.    Other than the restriction of avoiding reserved names and keywords,
  3396. the names of variables may be chosen arbitrarily.  Any sequence of
  3397. alphanumeric characters starting with an alphabetic character may be
  3398. used; the first 32 characters are significant.  It is worth noting that
  3399. `ode' identifies the independent variable by the fact that it is (or
  3400. should be) the only variable that has not appeared on the left side of
  3401. a differential equation or an initial value assignment.  If there is
  3402. more than than one such variable then no stepping takes place; instead,
  3403. an error message is printed.  If there is no such variable, a dummy
  3404. independent variable is invented and given the name `(indep)',
  3405. internally.
  3406.  
  3407. 
  3408. File: plotutils.info,  Node: Additional ode Examples,  Next: ode Invocation,  Prev: Simple ode Examples,  Up: ode
  3409.  
  3410. Additional examples using `ode'
  3411. ===============================
  3412.  
  3413.    We explain here how to use some additional features of `ode'.
  3414. However, the discussion below does not cover all of its capabilities.
  3415. For a complete list of command-line options, see *Note ode Invocation::.
  3416.  
  3417.    It is easy to use `ode' to create plots of great beauty.  An example
  3418. would be a plot of a *strange attractor*, namely the Lorenz attractor.
  3419. Suppose that a file named `lorenz' contains the following lines.
  3420.  
  3421.      # The Lorenz model, a system of three coupled ODE's with parameter r.
  3422.      x' = -3*(x-y)
  3423.      y' = -x*z+r*x-y
  3424.      z' = x*y-z
  3425.      
  3426.      r = 26
  3427.      x = 0; y = 1; z = 0
  3428.      
  3429.      print x, y
  3430.      step 0, 200
  3431.  
  3432. Then executing the command
  3433.  
  3434.      ode < lorenz | graph -T X -C -x -10 10 -y -10 10
  3435.  
  3436. would produce a plot of the Lorenz attractor (strictly speaking, a plot
  3437. of one of its two-dimensional projections).  You may produce a
  3438. Postscript plot of the Lorenz attractor, and print it, by doing
  3439. something like
  3440.  
  3441.      ode < lorenz | graph -T ps -x -10 10 -y -10 10 -W 0 | lpr
  3442.  
  3443. The `-W 0' ("zero width") option requests that `graph -T ps' use the
  3444. thinnest line possible, to improve the visual appearance of the plot on
  3445. a printer or other Postscript device.
  3446.  
  3447.    Besides plotting a visually striking object in real time, the Lorenz
  3448. attractor example shows how statements may be separated by semicolons,
  3449. rather than appearing on different lines.  It also shows how to use
  3450. symbolic constants.  In the description read by `ode' the parameter r
  3451. is a variable like x, y, and z.  But unlike them it is not updated
  3452. during stepping, since no formula for its derivative r' is given.
  3453.  
  3454.    Our second example deals with the interactive construction of a
  3455. `phase portrait': a set of solution curves with different initial
  3456. conditions.  Phase portraits are of paramount interest in the
  3457. qualitative theory of differential equations, and also possess
  3458. aesthetic appeal.
  3459.  
  3460.    Since a description read by `ode' may contain any number of `step'
  3461. statements, multiple solution curves may be plotted in a single run.
  3462. The most recent `print' statement will be used with each `step'
  3463. statement.  In practice, a phase portrait would be drawn from a few
  3464. well-chosen solution curves.  Choosing a good set of solution curves
  3465. may require experimentation, which makes interactivity and real-time
  3466. plotting all-important.
  3467.  
  3468.    As an example, consider a so-called Lotka-Volterra predator-prey
  3469. model.  Suppose that in a lake there are two species of fish:
  3470. A (the prey) who live by eating a plentiful supply of plants, and B (the
  3471. predator) who eat A.  Let x(t) be the population of A and y(t) the
  3472. population of B at time t.  A crude model for the interaction of A
  3473. and B is given by the equations
  3474.  
  3475.      x' = x(a-by)
  3476.      y' = y(cx-d)
  3477.  
  3478. where a, b, c, d are positive constants.  To draw a phase portrait for
  3479. this system interactively, you could type
  3480.  
  3481.      ode | graph -T X -C -x 0 5 -y 0 5
  3482.      x' = (a - b*y) * x
  3483.      y' = (c*x - d) * y
  3484.      a = 1; b = 1; c = 1; d = 1;
  3485.      print x, y
  3486.      x = 1; y = 2
  3487.      step 0, 10
  3488.      x = 1; y = 3
  3489.      step 0, 10
  3490.      x = 1; y = 4
  3491.      step 0, 10
  3492.      x = 1; y = 5
  3493.      step 0, 10
  3494.      .
  3495.  
  3496. Four curves will be drawn in succession, one per `step' line.  They
  3497. will be periodic; this periodicity is similar to the fluctuations
  3498. between predator and prey populations that occur in real-world
  3499. ecosystems.  On a color display the curves will appear in different
  3500. colors, since by default, `graph' changes the linemode between
  3501. datasets.  That feature may be turned off by using `graph -T X -B'
  3502. rather than `graph -T X'.
  3503.  
  3504.    It is sometimes useful to use `ode' and `graph' to plot discrete
  3505. points, which are not joined by line segments to form a curve.  Our
  3506. third example illustrates this.  Suppose the file `atwoods' contains
  3507. the lines
  3508.  
  3509.      m = 1
  3510.      M = 1.0625
  3511.      a = 0.5; adot = 0
  3512.      l = 10; ldot = 0
  3513.      
  3514.      ldot' = ( m * l * adot * adot - M * 9.8 + m * 9.8 * cos(a) ) / (m + M)
  3515.      l'    = ldot
  3516.      adot' = (-1/l) * (9.8 * sin(a) +  2 * adot * ldot)
  3517.      a'    = adot
  3518.      
  3519.      print l, ldot
  3520.      step 0, 400
  3521.  
  3522. The first few lines describe the functioning of a so-called swinging
  3523. Atwood's machine.  An ordinary Atwood's machine consists of a taut cord
  3524. draped over a pulley, with a mass attached to the cord at each end.
  3525. Normally, the heavier mass (M) would win against the lighter mass (m),
  3526. and draw it upward.  A swinging Atwood's machine allows the lighter
  3527. mass to swing back and forth as well as move vertically.
  3528.  
  3529.    The `print l, ldot' statement requests that the vertical position
  3530. and vertical velocity of the lighter mass be printed out at each step.
  3531. If you run the command
  3532.  
  3533.      ode < atwoods | graph -T X -x 9 11 -y -1 1 -m 0 -S 1 -X l -Y ldot
  3534.  
  3535. you will obtain a real-time plot.  The `-m 0' option requests that
  3536. successive data points not be joined by line segments, and the `-S 1'
  3537. option requests that plotting symbol #1 (a dot) be plotted at the
  3538. location of each point.  As you will see if you run this command, the
  3539. heavy mass does not win against the lighter mass.  Instead the machine
  3540. oscillates non-periodically.  Since the motion is non-periodic, the
  3541. plot benefits from being drawn as a sequence of unconnected points.
  3542.  
  3543.    We conclude by mentioning a few features of `ode' that may be useful
  3544. when things are not going quite right.  One of them is the `examine'
  3545. statement.  It may be used to discover pertinent information about any
  3546. variable in a system.  For details, see *Note Input Language::.
  3547.  
  3548.    Another useful feature is that the `print' statement may be used to
  3549. print out more than just the value of a variable.  As we have seen, if
  3550. the name of the variable is followed by `'', the derivative of the
  3551. variable will be printed instead.  In a similar way, following the
  3552. variable name with `?', `!', or `~' prints respectively the relative
  3553. single-step error, the absolute single-step error, or the accumulated
  3554. error (not currently implemented).  These quantities are discussed in
  3555. *Note Numerical Error::.
  3556.  
  3557.    The `print' statement may be more complicated than was shown in the
  3558. preceding examples.  Its general structure is
  3559.  
  3560.      print <pr-list> [every <const>] [from <const>]
  3561.  
  3562. The bracket notation `[...]' means that the enclosed statements are
  3563. optional.  Until now we have not mentioned the `every' clause or the
  3564. `from' clause.  The <pr-list> is familiar, however; it is simply a
  3565. comma-separated list of variables.  For example, in the statement
  3566.  
  3567.      print t, y, y' every 5 from 1
  3568.  
  3569. the <pr-list> is <t, y, y'>.  The clauses `every 5' and `from 1'
  3570. specify that printing should take place after every fifth step, and
  3571. that the printing should begin when the independent variable t
  3572. reaches 1.  An `every' clause is useful if you wish to `thin out' the
  3573. output generated by a `step' statement, and a `from' clause is useful
  3574. if you wish to view only the final portion of a solution curve.
  3575.  
  3576. 
  3577. File: plotutils.info,  Node: ode Invocation,  Next: Diagnostics,  Prev: Additional ode Examples,  Up: ode
  3578.  
  3579. `ode' command-line options
  3580. ==========================
  3581.  
  3582. The command-line options to `ode' are listed below.  There are several
  3583. sorts of option:
  3584.  
  3585.   1. Options affecting the way in which input is read.
  3586.  
  3587.   2. Options affecting the format of the output.
  3588.  
  3589.   3. Options affecting the choice of numerical solution scheme, and the
  3590.      error bounds that will be imposed on it.
  3591.  
  3592.   4. Options that request information.
  3593.  
  3594. The following option affects the way input is read.
  3595.  
  3596. `-f FILENAME'
  3597. `--input-file FILENAME'
  3598.      Read input from FILENAME before reading from standard input.
  3599.  
  3600. The following options affect the output format.
  3601.  
  3602. `-p PRECISION'
  3603. `--precision PRECISION'
  3604.      When printing numerical results, use PRECISION significant
  3605.      figures.  If this option is given, all output will be in scientific
  3606.      notation.
  3607.  
  3608. `-t'
  3609. `--title'
  3610.      Print a title line at the head of the output, naming the columns.
  3611.      If this option is given, the default print format will be
  3612.      scientific notation.
  3613.  
  3614. The following options specify the numerical integration scheme.  Only
  3615. one of the three basic option `-R', `-A', and `-E' may be specified.
  3616. The default is `-R' (Runge-Kutta-Fehlberg).
  3617.  
  3618. `-R [STEPSIZE]'
  3619. `--runge-kutta [STEPSIZE]'
  3620.      Use a fifth-order Runge-Kutta-Fehlberg algorithm, with an adaptive
  3621.      stepsize unless a constant stepsize is specified.  When a constant
  3622.      stepsize is specified and no error analysis is requested, then a
  3623.      classical fourth-order Runge-Kutta scheme is used.
  3624.  
  3625. `-A [STEPSIZE]'
  3626. `--adams-moulton [STEPSIZE]'
  3627.      Use a fourth-order Adams-Moulton predictor-corrector scheme, with
  3628.      an adaptive stepsize unless a constant stepsize, STEPSIZE, is
  3629.      specified.  The Runge-Kutta-Fehlberg algorithm is used to get past
  3630.      `bad' points (if any).
  3631.  
  3632. `-E [STEPSIZE]'
  3633. `--euler [STEPSIZE]'
  3634.      Use a `quick and dirty' Euler scheme, with a constant stepsize.
  3635.      The default value of STEPSIZE is 0.1.  Not recommended for serious
  3636.      applications.
  3637.  
  3638. `-h HMIN [HMAX]'
  3639. `--step-size-bound HMIN [HMAX]'
  3640.      Use a lower bound HMIN on the stepsize.  The numerical scheme will
  3641.      not let the stepsize go below HMIN.  The default is to allow the
  3642.      stepsize to shrink to the machine limit, i.e., the minimum nonzero
  3643.      double-precision floating point number.  The optional argument
  3644.      HMAX, if included, specifies a maximum value for the stepsize.
  3645.      It is useful in preventing the numerical routine from skipping
  3646.      quickly over an interesting region.
  3647.  
  3648. The following options set the error bounds on the numerical solution
  3649. scheme.
  3650.  
  3651. `-r RMAX [RMIN]'
  3652. `--relative-error-bound RMAX [RMIN]'
  3653.  
  3654. `-e EMAX [EMIN]'
  3655. `--absolute-error-bound EMAX [EMIN]'
  3656.      The `-r' option sets an upper bound on the relative single-step
  3657.      error.  If the `-r' option is used, the relative single-step error
  3658.      in any dependent variable will never exceed RMAX (the default for
  3659.      which is 10^(-9)).  If this should occur, the solution will be
  3660.      abandoned and an error message will be printed.  If the stepsize
  3661.      is not constant, the stepsize will be decreased `adaptively', so
  3662.      that the upper bound on the single-step error is not violated.
  3663.      Thus, choosing a smaller upper bound on the single-step error will
  3664.      cause smaller stepsizes to be chosen.  A lower bound RMIN may
  3665.      optionally be specified, to suggest when the stepsize should be
  3666.      increased (the default for RMIN is RMAX/1000).  The `-e' option is
  3667.      similar to `-r', but bounds the absolute rather than the relative
  3668.      single-step error.
  3669.  
  3670. `-s'
  3671. `--suppress-error-bound'
  3672.      Suppress the ceiling on single-step error, allowing `ode' to
  3673.      continue even if this ceiling is exceeded.  This may result in
  3674.      large numerical errors.
  3675.  
  3676. Finally, the following options request information.
  3677.  
  3678. `--help'
  3679.      Print a list of command-line options, and then exit.
  3680.  
  3681. `--version'
  3682.      Print the version number of `ode' and the plotting utilities
  3683.      package, and exit.
  3684.  
  3685. 
  3686. File: plotutils.info,  Node: Diagnostics,  Next: Numerical Error,  Prev: ode Invocation,  Up: ode
  3687.  
  3688. Diagnostic messages
  3689. ===================
  3690.  
  3691.    `ode' is always in one of two states:
  3692.  
  3693.    * Reading input.  The input includes a specification of a system of
  3694.      ordinary differential equations, together with instructions for
  3695.      solving it numerically: a `print' line and a `step' line.
  3696.  
  3697.    * Numerically solving a system, and printing the resulting output.
  3698.  
  3699. `ode' moves from the first to the second state after it sees and
  3700. processes a `step' line.  It returns to the first state after the
  3701. generated output has been printed.  Errors may occur in either the
  3702. `reading' state or the `solving' state, and may terminate computations
  3703. or even cause `ode' to exit.  We now explain the possible sorts of
  3704. error.
  3705.  
  3706.    While reading input, `ode' may encounter a syntax error: an
  3707. ungrammatical line that it is unable to parse.  (For a summary of its
  3708. input grammar, see *Note Input Language::.)  If so, it emits the error
  3709. message
  3710.  
  3711.      ode::nnn: syntax error
  3712.  
  3713. where `nnn' is the number of the line containing the error.  When the
  3714. `-f filename' option is used to specify an input file, the error
  3715. message will read
  3716.  
  3717.      ode:filename:nnn: syntax error
  3718.  
  3719. for errors encountered inside the input file.  Subsequently, when `ode'
  3720. begins reading the standard input, line numbers will start over again
  3721. from 1.
  3722.  
  3723.    No effort is made to recover from syntax errors in the input.
  3724. However, there is a meager effort to resynchronize, so that more than
  3725. one syntax error in a file may be found at the same time.
  3726.  
  3727.    It is also possible that a fatal arithmetic exception (such as a
  3728. division by zero, or a floating point overflow) may occur while `ode'
  3729. is reading input.  If such an exception occurs, `ode' will print an
  3730. "Floating point exception" error message and exit.  Arithmetic
  3731. exceptions are machine-dependent.  On some machines, the line
  3732.  
  3733.      y = 1/0
  3734.  
  3735. would induce an arithmetic exception.  Also on some machines (not
  3736. necessarily the same ones), the lines
  3737.  
  3738.      y = 1e100
  3739.      z = y^4
  3740.  
  3741. would induce an arithmetic exception.  That is because on most
  3742. machines, the double precision quantities that `ode' uses internally
  3743. are limited to a maximum size of approximately 1.8x10^308.
  3744.  
  3745.    When `ode' is in the `solving' state, i.e., computing a numerical
  3746. solution, similar arithmetic exceptions may occur.  If so, the solution
  3747. will be interrupted and a message resembling
  3748.  
  3749.      ode: arithmetic exception while calculating y'
  3750.  
  3751. will be printed.  However, `ode' will not exit; the exception will be
  3752. `caught'.  `ode' itself recognizes the following exceptional
  3753. conditions: square root of a negative number, logarithm of a
  3754. non-positive number, and negative number raised to a non-integer power.
  3755. `ode' will catch any of these operations before it is performed, and
  3756. print an error message specifying which illegal operation it has
  3757. encountered.
  3758.  
  3759.      ode: square root of a negative number while calculating y'
  3760.  
  3761. would be a typical error message.
  3762.  
  3763.    If the machine on which `ode' is running supports the `matherr'
  3764. facility for reporting errors in the computation of standard
  3765. mathematical functions, it will be used.  This facility reports domain
  3766. errors and range errors (overflows, underflows, and losses of
  3767. significance) that could occur when evaluating such functions as `log',
  3768. `gamma', etc.; again, before they are performed.  If the `matherr'
  3769. facility is present, the error message will be fairly informative.  For
  3770. example, the error message
  3771.  
  3772.      ode: range error (overflow) in lgamma while calculating y'
  3773.  
  3774. could be generated if the logarithmic gamma function `lgamma' is
  3775. evaluated at a value of its argument that is too large.  The generation
  3776. of any such message, except a message warning of an underflow, will
  3777. cause the numerical solution to be interrupted.
  3778.  
  3779.    There is another sort of error that may occur during numerical
  3780. solution: the condition that an error ceiling, which the user may set
  3781. with the `-r' option or the `-e' option, is exceeded.  This too will
  3782. cause the numerical solution to be abandoned, and `ode' to switch back
  3783. to reading input.
  3784.  
  3785. 
  3786. File: plotutils.info,  Node: Numerical Error,  Next: Running Time,  Prev: Diagnostics,  Up: ode
  3787.  
  3788. Numerical error and how to avoid it
  3789. ===================================
  3790.  
  3791.    This discussion is necessarily incomplete.  Entire books exist on any
  3792. subject mentioned below (e.g., floating point error).  Our goals are
  3793. modest: first, to introduce the basic notions of error analysis as they
  3794. apply to `ode'; second, to steer you around the more obvious pitfalls.
  3795. You should look through a numerical analysis text (e.g., Atkinson's
  3796. `Introduction to Numerical Analysis') before beginning this discussion.
  3797.  
  3798.    We begin with some key definitions.  The error of greatest concern is
  3799. the difference between the actual solution and the numerical
  3800. approximation to the solution; this is termed the *accumulated error*,
  3801. since the error is built up during each numerical step.  Unfortunately,
  3802. an estimate of this error is usually not available without knowledge of
  3803. the actual solution.  There are, however, several more usable notions
  3804. of error.  The *single-step error*, in particular, is the difference
  3805. between the actual solution and the numerical approximation to the
  3806. solution after any single step, assuming the value at the beginning of
  3807. the step is correct.
  3808.  
  3809.    The *relative single-step error* is the single-step error, divided
  3810. by the current value of the numerical approximation to the solution.
  3811. Why not divided by the current value of the solution itself?  The reason
  3812. is that the solution is not exactly known.  When free to choose a
  3813. stepsize, `ode' will do so on the basis of the relative single-step
  3814. error.  By default, it will choose the stepsize so as to maintain an
  3815. accuracy of eight significant digits in each step.  That is, it will
  3816. choose the stepsize so as not to violate an upper bound of 10^(-9) on
  3817. the relative single-step error.  This ceiling may be adjusted with the
  3818. `-r' option.
  3819.  
  3820.    Where does numerical error come from?  There are two sources.  The
  3821. first is the finite precision of machine computation.  All computers
  3822. work with floating point numbers, which are not real numbers, but only
  3823. an approximation to real numbers.  However, all computations performed
  3824. by `ode' are done to double precision, so floating point error tends to
  3825. be relatively small.  You may nonetheless detect the difference between
  3826. real numbers and floating point numbers by experimenting with the `-p
  3827. 17' option, which will print seventeen significant digits.  On most
  3828. machines, that is the precision of a double precision floating point
  3829. number.
  3830.  
  3831.    The second source of numerical error is often called the
  3832. *theoretical truncation error*.  It is the difference between the
  3833. actual solution and the approximate solution due solely to the
  3834. numerical scheme.  At the root of many numerical schemes is an infinite
  3835. series; for ordinary differential equations, it is a Taylor expansion.
  3836. Since the computer cannot compute all the terms in an infinite series,
  3837. a numerical scheme necessarily uses a truncated series; hence the term.
  3838. The single-step error is the sum of the theoretical truncation error
  3839. and the floating point error, though in practice the floating point
  3840. error is seldom included.  The single-step error estimated by `ode'
  3841. consists only of the theoretical truncation error.
  3842.  
  3843.    We say that a numerical scheme is *stable*, when applied to a
  3844. particular initial value problem, if the error accumulated during the
  3845. solution of the problem over a fixed interval decreases as the stepsize
  3846. decreases; at least, over a wide range of step sizes.  With this
  3847. definition both the Runge-Kutta-Fehlberg (`-R') scheme and the
  3848. Adams-Moulton (`-A') scheme are stable (a statement based more on
  3849. experience than on theoretical results) for a wide class of problems.
  3850.  
  3851.    After these introductory remarks, we list some common sources of
  3852. accumulated error and instability in any numerical scheme.  Usually,
  3853. problems with large accumulated error and instability are due to the
  3854. single-step error in the vicinity of a `bad' point being large.
  3855.  
  3856.   1. Singularities.
  3857.  
  3858.      `ode' should not be used to generate a numerical solution on any
  3859.      interval containing a singularity.  That is, `ode' should not be
  3860.      asked to step over points at which the system of differential
  3861.      equations is singular or undefined.
  3862.  
  3863.      You will find the definitions of singular point, regular singular
  3864.      point, and irregular singular point in any good differential
  3865.      equations text.  If you have no favorite, try Birkhoff and Rota's
  3866.      `Ordinary Differential Equations', Chapter 9.  Always locate and
  3867.      classify the singularities of a system, if any, before applying
  3868.      `ode'.
  3869.  
  3870.   2. Ill-posed problems.
  3871.  
  3872.      For `ode' to yield an accurate numerical solution on an interval,
  3873.      the true solution must be defined and well-behaved on that
  3874.      interval.  The solution must also be real.  Whenever any of these
  3875.      conditions is violated, the problem is said to be *ill-posed*.
  3876.      Ill-posedness may occur even if the system of differential
  3877.      equations is well-behaved on the interval.  Strange results, e.g.,
  3878.      the stepsize suddenly shrinking to the machine limit or the
  3879.      solution suddenly blowing up, may indicate ill-posedness.
  3880.  
  3881.      As an example of ill-posedness (in fact, an undefined solution)
  3882.      consider the innocent-looking problem:
  3883.  
  3884.           y' = y^2
  3885.           y(1) = -1
  3886.  
  3887.      The solution on the domain t > 0 is
  3888.  
  3889.           y(t) = -1/t.
  3890.  
  3891.      With this problem you must not compute a numerical solution on any
  3892.      interval that includes t=0.  To convince yourself of this, try to
  3893.      use the `step' statement
  3894.  
  3895.           step 1, -1
  3896.  
  3897.      on this system.  How does `ode' react?
  3898.  
  3899.      As another example of ill-posedness, consider the system
  3900.  
  3901.           y'=1/y
  3902.  
  3903.      which is undefined at y=0.  The general solution is
  3904.  
  3905.           y = +/- (2(t-C))^(1/2),
  3906.  
  3907.      so that if the condition y(2)=2 is imposed, the solution will be
  3908.      (2t)^(1/2).  Clearly, if the domain specified in a `step'
  3909.      statement includes negative values of t, the generated solution
  3910.      will be bogus.
  3911.  
  3912.      In general, when using a constant stepsize you should be careful
  3913.      not to `step over' bad points or bad regions.  When allowed to
  3914.      choose a stepsize adaptively, `ode' will often spot bad points,
  3915.      but not always.
  3916.  
  3917.   3. Critical points.
  3918.  
  3919.      An *autonomous* system is one that does not include the independent
  3920.      variable explicitly on the right-hand side of any differential
  3921.      equation.  A *critical point* for such a system is a point at
  3922.      which all right-hand sides equal zero.  For example, the system
  3923.  
  3924.           y' = 2x
  3925.           x' = 2y
  3926.  
  3927.      has only one critical point, at (x,y) = (0,0).
  3928.  
  3929.      A critical point is sometimes referred to as a *stagnation point*.
  3930.      That is because a system at a critical point will remain there
  3931.      forever, though a system near a critical point may undergo more
  3932.      violent motion.  Under some circumstances, passing near a critical
  3933.      point may give rise to a large accumulated error.
  3934.  
  3935.      As an exercise, solve the system above using `ode', with the
  3936.      initial condition x(0) = y(0) = 0.  The solution should be
  3937.      constant in time.  Now do the same with points near the critical
  3938.      point.  What happens?
  3939.  
  3940.      You should always locate the critical points of a system before
  3941.      attempting a solution with `ode'.  Critical points may be
  3942.      classified (as equilibrium, vortex, unstable, stable, etc.) and
  3943.      this classification may be of use.  To find out more about this,
  3944.      consult any book dealing with the qualitative theory of
  3945.      differential equations (e.g., Birkhoff and Rota's `Ordinary
  3946.      Differential Equations', Chapter 6).
  3947.  
  3948.   4. Unsuitable numerical schemes
  3949.  
  3950.      If the results produced by `ode' are bad in the sense that
  3951.      instability appears to be present, or an unusually small stepsize
  3952.      needs to be chosen needed in order to reduce the single-step error
  3953.      to manageable levels, it may simply be that the numerical scheme
  3954.      being used is not suited to the problem.  For example, `ode'
  3955.      currently has no numerical scheme which handles so-called `stiff'
  3956.      problems very well.
  3957.  
  3958.      As an example, you may wish to examine the stiff problem:
  3959.  
  3960.           y' = -100 + 100t + 1
  3961.           y(0) = 1
  3962.  
  3963.      on the domain [0,1].  The exact solution is
  3964.  
  3965.           y(t) = e^(-100t) + t.
  3966.  
  3967.      It is a useful exercise to solve this problem with `ode' using
  3968.      various numerical schemes, stepsizes, and relative single-step
  3969.      error bounds, and compare the generated solution curves with the
  3970.      actual solution.
  3971.  
  3972.    There are several rough and ready heuristic checks you may perform on
  3973. the accuracy of any numerical solution produced by `ode'.  We discuss
  3974. them in turn.
  3975.  
  3976.   1. Examine the stability of  solution curves: do they converge?
  3977.  
  3978.      That is, check how changing the stepsize affects a solution curve.
  3979.      As the stepsize decreases, the curve should converge.  If it does
  3980.      not, then either the stepsize is not small enough or the numerical
  3981.      scheme is not suited to the problem.  In practice, you would
  3982.      proceed as follows.
  3983.  
  3984.         * If using an adaptive stepsize, superimpose the solution
  3985.           curves for successively smaller bounds on the relative
  3986.           single-step error (obtained with, e.g., `-r 1e-9', `-r
  3987.           1e-11', `-r 1e-13', ...).  If the curves converge then the
  3988.           solution is to all appearances stable, and your accuracy is
  3989.           sufficient.
  3990.  
  3991.         * If employing a constant stepsize, perform a similar analysis
  3992.           by successively halving the stepsize.
  3993.  
  3994.      The following example is one that you may wish to experiment with.
  3995.      Make a file named `qcd' containing:
  3996.  
  3997.           # an equation arising in QCD (quantum chromodynamics)
  3998.           f'   = fp
  3999.           fp'  = -f*g^2
  4000.           g'   = gp
  4001.           gp'  = g*f^2
  4002.           f = 0; fp = -1; g = 1; gp = -1
  4003.           
  4004.           print t, f
  4005.           step 0, 5
  4006.  
  4007.      Next make a file named `stability', containing the lines:
  4008.  
  4009.           : sserr is the bound on the relative single-step error
  4010.           for sserr
  4011.           do
  4012.           ode -r $sserr < qcd
  4013.           done | spline -n 500 | graph -T X -C
  4014.  
  4015.      This is a `shell script', which when run will superimpose numerical
  4016.      solutions with specified bounds on the relative single-step error.
  4017.      To run it, type:
  4018.  
  4019.           sh stability 1 .1 .01 .001
  4020.  
  4021.      and a plot of the solutions with the specified error bounds will be
  4022.      drawn.  The convergence, showing stability, should be quite
  4023.      illuminating.
  4024.  
  4025.   2. Check invariants of the system: are they constant?
  4026.  
  4027.      Many systems have invariant quantities.  For example, if the
  4028.      system is a mathematical model of a `conservative' physical system
  4029.      then the `energy' (a particular function of the dependent
  4030.      variables of the system) should be constant in time.  In general,
  4031.      knowledge about the qualitative behavior of any dependent variable
  4032.      may be used to check the quality of the solution.
  4033.  
  4034.   3. Check a family of solution curves: do they diverge?
  4035.  
  4036.      A rough idea of how error is propagated is obtained by viewing a
  4037.      family of solution curves about the numerical solution in
  4038.      question, obtained by varying the initial conditions.  If they
  4039.      diverge sharply--that is, if two solutions which start out very
  4040.      close nonetheless end up far apart--then the quality of the
  4041.      numerical solution is dubious.  On the other hand, if the curves
  4042.      do not diverge sharply then any error that is present will in all
  4043.      likelihood not increase by more than an order of magnitude or so
  4044.      over the interval.  Problems exhibiting no sharp divergence of
  4045.      neighboring solution curves are sometimes called
  4046.      *well-conditioned*.
  4047.  
  4048. 
  4049. File: plotutils.info,  Node: Running Time,  Next: Input Language,  Prev: Numerical Error,  Up: ode
  4050.  
  4051. Running time
  4052. ============
  4053.  
  4054.    The time required for `ode' to solve numerically a system of
  4055. ordinary differential equations depends on a great many factors.  A few
  4056. of them are: number of equations, complexity of equations (number of
  4057. operators and nature of the operators), and number of steps taken
  4058. (a very complicated function of the difficulty of solution, unless
  4059. constant stepsizes are used).  The most effective way to gauge the time
  4060. required for solution of a system is to clock a short or imprecise run
  4061. of the problem, and reason as follows: the time required to take two
  4062. steps is roughly twice that required for one; and there is a
  4063. relationship between the number of steps required and the relative error
  4064. ceiling chosen.  That relationship depends on the numerical scheme being
  4065. used, the difficulty of solution, and perhaps on the magnitude of the
  4066. error ceiling itself.  A few carefully planned short runs may be used
  4067. to determine this relationship, enabling a long but imprecise run to be
  4068. used as an aid in projecting the cost of a more precise run over the
  4069. same region.  Lastly, if a great deal of data is printed, it is likely
  4070. that more time is spent in printing the results than in computing the
  4071. numerical solution.
  4072.  
  4073. 
  4074. File: plotutils.info,  Node: Input Language,  Next: ODE Bibliography,  Prev: Running Time,  Up: ode
  4075.  
  4076. The `ode' input language formally specified
  4077. ===========================================
  4078.  
  4079.    The following is a formal specification of the grammar for `ode''s
  4080. input language, in Backus-Naur form.  Nonterminal symbols in the
  4081. grammar are enclosed in angle brackets.  Terminal tokens are in all
  4082. capitals.  Bare words and symbols stand for themselves.
  4083.  
  4084.      <program>    ::=        ... empty ...
  4085.                     |  <program> <statement>
  4086.      
  4087.      
  4088.      <statement>  ::=  SEP
  4089.                     |  IDENTIFIER = <const> SEP
  4090.                     |  IDENTIFIER ' = <expression> SEP
  4091.                     |  print <printlist> <optevery> <optfrom> SEP
  4092.                     |  step <const> , <const> , <const> SEP
  4093.                     |  step <const> , <const> SEP
  4094.                     |  examine IDENTIFIER SEP
  4095.      
  4096.      
  4097.      <printlist>  ::=  <printitem>
  4098.                     |  <printlist> , <printitem>
  4099.      
  4100.      
  4101.      <printitem>  ::=  IDENTIFIER
  4102.                     |  IDENTIFIER '
  4103.                     |  IDENTIFIER ?
  4104.                     |  IDENTIFIER !
  4105.                     |  IDENTIFIER ~
  4106.      
  4107.      
  4108.      <optevery>   ::=        ... empty ...
  4109.                     |  every <const>
  4110.      
  4111.      
  4112.      <optfrom>    ::=        ... empty ...
  4113.                     |  from <const>
  4114.      
  4115.      
  4116.      <const>      ::=  <expression>
  4117.      
  4118.      
  4119.      <expression> ::=  ( <expression> )
  4120.                     |  <expression> + <expression>
  4121.                     |  <expression> - <expression>
  4122.                     |  <expression> * <expression>
  4123.                     |  <expression> / <expression>
  4124.                     |  <expression> ^ <expression>
  4125.                     |  FUNCTION ( <expression> )
  4126.                     |  - <expression>
  4127.                     |  NUMBER
  4128.                     |  IDENTIFIER
  4129.  
  4130. Since this grammar is ambiguous, the following table summarizes the
  4131. precedences and associativities of operators within expressions.
  4132. Precedences decrease from top to bottom.
  4133.  
  4134.      Class           Operators    Associativity
  4135.      
  4136.      Exponential         ^            right
  4137.      Multiplicative      * /          left
  4138.      Additive            + -          left
  4139.  
  4140.    As noted in the grammar, there are six types of nontrivial statement.
  4141. We now explain the effects (the `semantics') of each type, in turn.
  4142.  
  4143.   1. IDENTIFIER ' = <expression>
  4144.  
  4145.      This defines a first-order differential equation.  The derivative
  4146.      of IDENTIFIER is specified by <expression>.  If a dynamic variable
  4147.      does not appear on the left side of a statement of this form, its
  4148.      derivative is assumed to be zero.  That is, it is a symbolic
  4149.      constant.
  4150.  
  4151.   2. IDENTIFIER = <const>
  4152.  
  4153.      This sets the value of IDENTIFIER to the current value of
  4154.      <expression>.  Dynamic variables that have not been initialized in
  4155.      this way are set to zero.
  4156.  
  4157.   3. step <const> , <const>
  4158.  
  4159.   4. step <const> , <const> , <const>
  4160.  
  4161.      A `step' statement causes the numerical scheme to be executed.  The
  4162.      first <const> is the initial value of the independent variable.
  4163.      The second is its final value.  The third is a stepsize; if given,
  4164.      it overrides any stepsize that may be specified on the command
  4165.      line.  Usually the stepsize is not specified, and it varies
  4166.      adaptively as the computation proceeds.
  4167.  
  4168.   5. print <printlist> [ every <const> ] [ from <const> ]
  4169.  
  4170.      A `print' statement controls the content and frequency of the
  4171.      numerical output.  <printlist> is a comma-separated list of
  4172.      IDENTIFIERs, where each IDENTIFIER may be followed by `'',
  4173.      denoting the derivative, or `?', denoting the relative single-step
  4174.      error, or `!', denoting the absolute single-step error, or `~',
  4175.      denoting the accumulated error (not currently implemented).  The
  4176.      specified values are printed in the order they are found.  Both the
  4177.      `every' clause and the `from' clause are optional.  If the `every'
  4178.      clause is present, a printing occurs every <const> iterations of
  4179.      the numerical algorithm.  The default is to print on every
  4180.      iteration (i.e. `every 1').  The first and last values are always
  4181.      printed.  If the `from' clause is present, it means to begin
  4182.      printing when the independent variable reaches or exceeds <const>.
  4183.      The default is to begin printing immediately.
  4184.  
  4185.      If no `print' statement has been supplied, then the independent
  4186.      variable and all dependent variables which have differential
  4187.      equations associated with them are printed.  The independent
  4188.      variable is printed first; the dependent variables follow in the
  4189.      order their equations were given.
  4190.  
  4191.   6. examine IDENTIFIER
  4192.  
  4193.      An `examine' statement, when executed, causes a table of
  4194.      interesting information about the named variable to be printed on
  4195.      the standard output.  For example, if the statement `examine y'
  4196.      were encountered after execution of the `ode to Euler' example
  4197.      discussed elsewhere, the output would be:
  4198.  
  4199.           "y" is a dynamic variable
  4200.           value:2.718282
  4201.           prime:2.718282
  4202.           sserr:1.121662e-09
  4203.           aberr:3.245638e-09
  4204.           acerr:0
  4205.            code:  push "y"
  4206.  
  4207.      The phrase `dynamic variable' means that there is a differential
  4208.      equation describing the behavior of y.  The numeric items in the
  4209.      table are:
  4210.  
  4211.     value
  4212.           Current value of the variable.
  4213.  
  4214.     prime
  4215.           Current derivative of the variable.
  4216.  
  4217.     sserr
  4218.           Relative single-step error for the last step taken.
  4219.  
  4220.     aberr
  4221.           Absolute single-step error for the last step taken.
  4222.  
  4223.     acerr
  4224.           Total error accumulated during the most recent `step'
  4225.           statement.  Not currently implemented.
  4226.  
  4227.      The `code' section of the table lists the stack operations required
  4228.      to compute the derivative of y (somewhat reminiscent of a reverse
  4229.      Polish calculator).  This information may be useful in discovering
  4230.      whether the precedences in the differential equation statement
  4231.      were interpreted correctly, or in determining the time or space
  4232.      expense of a particular calculation.  `push "y"' means to load y's
  4233.      value on the stack, which is all that is required to compute its
  4234.      derivative in this case.
  4235.  
  4236.    The grammar for the `ode' input language contains four types of
  4237. terminal token: FUNCTION, IDENTIFIER, NUMBER, and SEP.  They have the
  4238. following meanings.
  4239.  
  4240.   1. FUNCTION
  4241.  
  4242.      One of the words: abs, sqrt, exp, log, ln, log10, sin, cos, tan,
  4243.      asin, acos, atan, sinh, cosh, tanh, asinh, acosh, atanh, floor,
  4244.      ceil, besj0, besj1, besy0, besy1, erf, erfc, inverf, lgamma,
  4245.      gamma, norm, invnorm, ibeta, igamma.  These are defined to have
  4246.      the same meaning as in the plotting program `gnuplot'.  All
  4247.      functions take a single argument, except for ibeta, which takes
  4248.      three, and igamma, which takes two.  For trigonometric functions,
  4249.      all arguments are expressed in radians.  The atan function is
  4250.      defined to give a value between -PI/2 and PI/2 (inclusive).
  4251.  
  4252.   2. IDENTIFIER
  4253.  
  4254.      A sequence of alphanumeric characters starting with an alphabetic
  4255.      character.  The first 32 characters are significant.  Upper and
  4256.      lower-case letters are distinct.  In identifiers, the underscore
  4257.      character is considered alphabetic.  Function names and keywords
  4258.      may not be used as identifiers, nor may `PI'.
  4259.  
  4260.   3. NUMBER
  4261.  
  4262.      A non-empty sequence of digits possibly containing a decimal point
  4263.      and possibly followed by an exponent.  An exponent is `e' or `E',
  4264.      followed by an (optionally signed) one, two, or three-digit
  4265.      number.  All numbers and all parts of numbers are radix 10.
  4266.      A number may not contain any white space.  The special word `PI' is
  4267.      a number.
  4268.  
  4269.   4. SEP
  4270.  
  4271.      A separator: a semicolon or a (non-escaped) newline.
  4272.  
  4273.    In the `ode' input language, upper and lower-case letters are
  4274. distinct.  Comments begin with the character `#' and continue to the
  4275. end of the line.  Long lines may be continued onto a second line by
  4276. ending the first line with a backslash (`\').  That is because the
  4277. combination backslash-newline is equivalent to a space.
  4278.  
  4279.    Spaces or tabs are required in the input whenever they are needed to
  4280. separate identifiers, numbers, and keywords from one another.  Except as
  4281. separators, they are ignored.
  4282.  
  4283. 
  4284. File: plotutils.info,  Node: ODE Bibliography,  Prev: Input Language,  Up: ode
  4285.  
  4286. Bibliography on `ode' and solving differential equations
  4287. ========================================================
  4288.  
  4289.      K. E. Atkinson, `An Introduction to Numerical Analysis', Wiley,
  4290.      1978.  Chapter 6 contains a discussion of the literature on the
  4291.      numerical solution of ordinary differential equations.
  4292.  
  4293.      G. Birkhoff and G. Rota, `Ordinary Differential Equations', 4th
  4294.      ed., Wiley, 1989.
  4295.  
  4296.      N. B. Tufillaro, T. Abbott, and J. Reilly, `An Experimental
  4297.      Approach to Nonlinear Dynamics and Chaos', Addison-Wesley, 1992.
  4298.      Appendix C discusses an earlier version of `ode'.
  4299.  
  4300.      N. B. Tufillaro, E. F. Redish, and J. S. Risley, "`ode':
  4301.      A numerical simulation of ordinary differential equations," pp.
  4302.      480-481 in `Proceedings of the Conference on Computers in Physics
  4303.      Instruction', Addison-Wesley, 1990.
  4304.  
  4305. 
  4306. File: plotutils.info,  Node: libplot,  Next: Appendices,  Prev: ode,  Up: Top
  4307.  
  4308. `libplot', a Function Library
  4309. *****************************
  4310.  
  4311. * Menu:
  4312.  
  4313. * libplot Overview::    Programming with libplot: An overview
  4314. * C Programming::       C programming with libplot
  4315. * Functions::           A list of functions contained in libplot
  4316. * Driver Parameters::   Device driver parameters
  4317.  
  4318. 
  4319. File: plotutils.info,  Node: libplot Overview,  Next: C Programming,  Prev: libplot,  Up: libplot
  4320.  
  4321. Programming with `libplot': An overview
  4322. =======================================
  4323.  
  4324.    GNU `libplot' is a library of functions for drawing two-dimensional
  4325. vector graphics.  It can produce smooth, double-buffered animations for
  4326. the X Window System, and graphical output in many different file
  4327. formats.  It is `device-independent' in the sense that its API
  4328. (application programming interface) is to a large extent independent of
  4329. the display type or output format.
  4330.  
  4331.    The graphical objects which `libplot' can draw include paths,
  4332. circles and ellipses, points, markers, and `adjusted labels' (justified
  4333. text strings).  A *path* is a sequence of line segments, circular arcs,
  4334. and/or elliptic arcs.  Paths may be open or closed.  User-specified
  4335. filling of paths, circles, and ellipses is supported (fill color,
  4336. as well as pen color, may be specified).  There is support for
  4337. maintaining a Postscript-style stack of graphics contexts, i.e.,
  4338. a stack of drawing attribute sets.  User-specifiable attributes other
  4339. than pen color and fill color include path-related attributes such as
  4340. line type and line width, and text-related attributes such as font
  4341. name, font size, and text angle.
  4342.  
  4343.    The fundamental abstraction provided by `libplot' is that of a
  4344. *Plotter*.  A Plotter is an object with an interface for the drawing of
  4345. vector graphics which is similar to the interface provided by a
  4346. traditional pen plotter.  There are many types of Plotter, which differ
  4347. in the display type they produce output for.  Any number of Plotters,
  4348. of the same or different types, may exist simultaneously in an
  4349. application.
  4350.  
  4351.    The drawing operations supported by Plotters of different types are
  4352. identical, in agreement with the principle of device independence.
  4353. So a graphics application that is linked with `libplot' may easily be
  4354. written so as to produce output for any or all of the supported output
  4355. formats.
  4356.  
  4357.    The following are the currently supported types of Plotter.
  4358.  
  4359.    * X Plotters.  An X Plotter, when opened, pops up a window on an
  4360.      X Window System display and draws graphics in it.  The window will
  4361.      be `spun off' when the Plotter is closed; if it is subsequently
  4362.      reopened, a new window will be popped up.  A spun-off window will
  4363.      remain on the screen but will vanish if you type `q' or click your
  4364.      mouse in it.  Future releases may permit X Plotters, when
  4365.      reopened, to reuse an existing window.
  4366.  
  4367.    * X Drawable Plotters.  An X Drawable Plotter draws graphics in one
  4368.      or two specified drawables associated with an X Window System
  4369.      display.  A `drawable' is either a window or a pixmap.  The
  4370.      drawables must be passed to the Plotter as parameters.  (*Note
  4371.      Driver Parameters::.)
  4372.  
  4373.    * Postscript Plotters.  A Postscript Plotter produces Postscript
  4374.      output and directs it to a file or other specified output stream.
  4375.      If only a single page of graphics is drawn on the Plotter then its
  4376.      output is in EPS (encapsulated Postscript) format, so it may be
  4377.      included in another document.  It may also be edited with the
  4378.      `idraw' drawing editor.
  4379.  
  4380.    * Fig Plotters.  A Fig Plotter produces output in Fig format and
  4381.      directs it to a file or other specified output stream.  The output
  4382.      may be edited with the `xfig' drawing editor.  The `xfig' editor
  4383.      will export drawings in various other formats for inclusion in
  4384.      documents.
  4385.  
  4386.    * HP-GL Plotters.  An HP-GL Plotter produces output in the
  4387.      Hewlett-Packard Graphics Language (by default, in HP-GL/2), and
  4388.      directs it to a file or other specified output stream.  The output
  4389.      may be sent to a Hewlett-Packard LaserJet printer or plotter, or
  4390.      included in another document.
  4391.  
  4392.    * Tektronix Plotters.  A Tektronix Plotter produces output in
  4393.      Tektronix 4014 format and directs it to a file or other specified
  4394.      output stream.  The output may be displayed on any Tektronix 4014
  4395.      emulator.  Such an emulator is built into `xterm', the X Window
  4396.      System terminal emulation program.  The MS-DOS version of `kermit'
  4397.      also includes such an emulator.
  4398.  
  4399.    * Metafile Plotters.  A Metafile Plotter produces output in GNU
  4400.      metafile format and directs it to a file or other specified output
  4401.      stream.  This format is an extended version of the `plot(5)'
  4402.      format found on some other operating systems.  (*Note
  4403.      Metafiles::.)  It may be translated to other formats by an
  4404.      invocation of GNU `plot'.  (*Note plot::.)
  4405.  
  4406.    A distinction among these types of Plotter is that all except X and
  4407. X Drawable Plotters write graphics to a file or other output stream.  An
  4408. X Plotter pops up its own windows, and an X Drawable Plotter draws
  4409. graphics in one or two X drawables.
  4410.  
  4411.    Another distinction is that X, X Drawable, Tektronix and Metafile
  4412. Plotters are real-time.  This means that they draw graphics or write to
  4413. an output stream as the drawing operations are invoked on them.
  4414. Postscript, Fig and HP-GL Plotters are not real-time, since their output
  4415. streams can only be emitted after all functions have been called.  For a
  4416. Postscript Plotter this is because a `bounding box' line must be placed
  4417. at the head of the output file.  For a Fig Plotter it is because color
  4418. definitions must be placed at the head of the output file.
  4419.  
  4420.    The most important operations supported by any Plotter are `openpl'
  4421. and `closepl', which open and close it.  Graphics may be drawn, and
  4422. drawing attributes set, only within an `openpl'...`closepl' pair.  The
  4423. graphics produced within each `openpl'...`closepl' pair constitute a
  4424. `page'.  In principle, any Plotter may be opened and closed arbitrarily
  4425. many times.  An X Plotter displays each page in a separate X window,
  4426. and an HP-GL Plotter renders each page as a separate physical page.
  4427. X Drawable Plotters and Tektronix Plotters manipulate a single drawable
  4428. or display, on which pages are displayed in succession.  Plotters that
  4429. do not draw in real time (Postscript, Fig, and HP-GL Plotters) may wait
  4430. until their existence comes to an end (i.e., until they are deleted)
  4431. before outputting their pages of graphics.
  4432.  
  4433.    In the current release of `libplot', Postscript Plotters delay
  4434. outputting graphics in this way, but HP-GL Plotters output each page of
  4435. graphics individually, i.e., when `closepl' is invoked.  Fig Plotters
  4436. are similar, but output at most one page of graphics.  That is because
  4437. Fig format currently supports only a single page.  On account of this
  4438. potential problem with Fig Plotters, all Plotters support an additional
  4439. operation: `outfile'.  The output stream for a Plotter, if it has one,
  4440. may be altered by invoking `outfile' on it.  `outfile' may only be
  4441. invoked outside an `openpl'...`closepl' pair.  By using `outfile', a
  4442. programmer may produce multipage graphics output from Fig Plotters by
  4443. directing output to a sequence of output streams, one per page.  The use
  4444. of `outfile' in other contexts is strongly deprecated.
  4445.  
  4446.    There are several other basic operations which any Plotter supports.
  4447. The `graphics display' drawn in by a Plotter is a square or rectangular
  4448. region on a display device.  But when using any Plotter to draw
  4449. graphics, a user will specify the coordinates of graphical objects in
  4450. device-independent `user coordinates', rather than in device
  4451. coordinates.  A Plotter relates the user coordinate system to the
  4452. device coordinate system by performing an affine transformation, which
  4453. must be specified by the user.
  4454.  
  4455.    Immediately after invoking `openpl' to open a Plotter, an
  4456. application should invoke the `space' operation to initialize this
  4457. affine transformation.  This invocation specifies the rectangular region
  4458. (in user coordinates) that will be mapped by the Plotter to the graphics
  4459. display.  The affine transformation may be updated at any later time by
  4460. invoking `space' again, or by invoking `fconcat'.  The `fconcat'
  4461. operation will `concatenate' (i.e., compose) the current affine
  4462. transformation transformation with any specified affine map.  This sort
  4463. of concatenation is a capability familiar from, e.g., Postscript.
  4464.  
  4465.    Each Plotter maintains a Postscript-style stack of graphics contexts.
  4466. This makes possible the rapid, efficient drawing of complicated pages of
  4467. graphics.  A graphics context includes the current affine
  4468. transformation from the user coordinate system to the device coordinate
  4469. system.  It also includes such modal drawing attributes as graphics
  4470. cursor position, linemode, line width, pen and fill colors, and the
  4471. font used for drawing text.  The state of any uncompleted path (if any)
  4472. is included as well, since paths may be drawn incrementally, one
  4473. portion (line segment or arc) at a time.  The current graphics context
  4474. is pushed onto the stack by calling `savestate', and popped off by
  4475. calling `restorestate'.
  4476.  
  4477.    To permit vector graphics animation, any page of graphics may be
  4478. split into `frames'.  A frame is ended, and a new frame is begun, by
  4479. invoking the `erase' operation.  On a Plotter that does real-time
  4480. plotting (i.e., an X, X Drawable, Tektronix, or Metafile Plotter), this
  4481. erases all plotted objects from the graphics display, allowing a new
  4482. frame to be drawn.  Displaying a sequence of frames in succession
  4483. creates the illusion of smooth animation.
  4484.  
  4485.    On a Plotter that does not do real-time plotting (i.e., a
  4486. Postscript, Fig or HP-GL Plotter), invoking `erase' deletes all plotted
  4487. objects from an internal buffer.  For this reason, Plotters that do not
  4488. do real-time plotting will display only the last frame of any
  4489. multiframe page.
  4490.  
  4491. 
  4492. File: plotutils.info,  Node: C Programming,  Next: Functions,  Prev: libplot Overview,  Up: libplot
  4493.  
  4494. C Programming with `libplot'
  4495. ============================
  4496.  
  4497. * Menu:
  4498.  
  4499. * The C API::                   The C application programming interface
  4500. * C Compiling and Linking::     C compiling and linking
  4501. * Sample C Drawings::           Sample drawings in C
  4502. * Sample C Animations::         Sample animations in C
  4503. * X Programming::        Advanced X Window System programming
  4504.  
  4505. 
  4506. File: plotutils.info,  Node: The C API,  Next: C Compiling and Linking,  Prev: C Programming,  Up: C Programming
  4507.  
  4508. The C application programming interface
  4509. ---------------------------------------
  4510.  
  4511.    `libplot' has bindings for several programming languages.
  4512. Regardless of which language binding is used, the concepts behind
  4513. `libplot' (Plotters, and a fixed set of operations that can be applied
  4514. to any Plotter) remain the same.  However, the ways in which Plotters
  4515. are manipulated (created, selected for use, and deleted) may differ
  4516. between bindings.
  4517.  
  4518.    If you are writing an application in C that will use `libplot' to
  4519. draw vector graphics, the first thing you need to know is how, in the
  4520. C binding, Plotters are manipulated.  There are four functions for
  4521. this: `newpl', `selectpl', `deletepl', and the parameter-setting
  4522. function `parampl'.
  4523.  
  4524.    The `newpl' function will create a Plotter of specified type.  Its
  4525. first argument may be "X", "Xdrawable", "ps", "fig", "hpgl", "tek", or
  4526. "meta".  It returns an integer (a "handle") that may be used to refer
  4527. to the Plotter.  Before using a Plotter that you have created (i.e.,
  4528. before invoking any of the `libplot' operations on it), you must select
  4529. the Plotter for use by calling `selectpl'.  Only one Plotter may be
  4530. selected at a time, but by calling `selectpl' you may switch from
  4531. Plotter to Plotter at any time, even when the selected Plotter is open.
  4532. A Plotter that is not currently selected can be deleted, and its
  4533. storage freed, by calling `deletepl'.
  4534.  
  4535.    Strictly speaking, you do not need to call `newpl', `selectpl', or
  4536. `deletepl' in order to draw graphics.  That is because at startup, a
  4537. single Metafile Plotter that writes to standard output (with
  4538. handle `0') is automatically created and selected.  The presence of
  4539. this default Plotter is for compatibility with pre-GNU versions of
  4540. `libplot'.  Of course, you may not wish to obtain output in metafile
  4541. format, and you may not wish to write to standard output.
  4542.  
  4543.    You should get into the habit of calling `deletepl' whenever you are
  4544. finished using a Plotter.  In general, Plotters that do not plot
  4545. graphics in real time (Postscript Plotters in particular) write out
  4546. graphics only when the plot is finished, and `deletepl' is called.
  4547.  
  4548.    The following table summarizes the action of the four functions in
  4549. the C binding that are used for Plotter manipulation.
  4550.  
  4551. int newpl (const char *TYPE, FILE *IN, FILE *OUT, FILE *ERR);
  4552.      newpl creates a Plotter of type TYPE, where TYPE may be "X",
  4553.      "Xdrawable", "ps", "fig", "hpgl", "tek", or "meta".  The Plotter
  4554.      will have input stream IN, output stream OUT, and error stream
  4555.      ERR.  Currently, all Plotters are write-only and IN is ignored.
  4556.      X Plotters and X Drawable Plotters write graphics to an X Window
  4557.      System display rather than to an output stream, so if TYPE is "X"
  4558.      or "Xdrawable" then OUT is ignored as well.  Error messages
  4559.      (if any) are written to the stream ERR, unless ERR is NULL.  The
  4560.      return value from newpl is a `handle': a nonnegative integer by
  4561.      which the newly created Plotter is referred to.  A negative return
  4562.      value indicates the Plotter could not be created.
  4563.  
  4564. int selectpl (int HANDLE);
  4565.      selectpl selects a Plotter, referred to by its handle, for use.  If
  4566.      any of the basic `libplot' operations is subsequently invoked, it
  4567.      will be applied to the selected Plotter.  Only one Plotter may be
  4568.      selected at a time.  A negative return value indicates the Plotter
  4569.      could not be selected.
  4570.  
  4571.      At startup, a single Metafile Plotter that writes to standard
  4572.      output (with handle `0') is automatically created and selected.
  4573.  
  4574. int deletepl (int HANDLE);
  4575.      deletepl deletes a Plotter, referred to by its handle.  The Plotter
  4576.      must not be selected at the time it is deleted.  A negative return
  4577.      value indicates the Plotter could not be deleted.
  4578.  
  4579. int parampl (const char *PARAMETER, void *VALUE);
  4580.      parampl sets the value of the device driver parameter PARAMETER to
  4581.      VALUE.  Device driver parameters are used for setting Plotter
  4582.      options.  The parameter values in effect at the time any Plotter
  4583.      is created are copied into it.  For most parameters, VALUE should
  4584.      be a `char *', i.e., a string.  Unrecognized parameters are
  4585.      ignored.  For a list of the recognized parameters and their
  4586.      meaning, see *Note Driver Parameters::.
  4587.  
  4588.    Up to now we have not discussed the fourth function, `parampl'.
  4589. Even though the Plotter interface is largely Plotter-independent, it is
  4590. useful to be able to specify certain aspects of a Plotter's behavior at
  4591. the time it is created.  Plotter behavior is captured by a manageable
  4592. number of parameters, which we call *device driver parameters*.
  4593. A value for any parameter can be specified by calling `parampl'.  This
  4594. function does not operate on any particular Plotter: it belongs to the
  4595. C binding as a whole.  The parameter values used by any Plotter are
  4596. constant over the lifetime of the Plotter, and are those that were in
  4597. effect when the Plotter was created.
  4598.  
  4599.    Actually, a slightly more sophisticated rule applies.  If at Plotter
  4600. creation time a parameter is set, the value specified by the most recent
  4601. call to `parampl' will be the value used by the Plotter.  If at Plotter
  4602. creation time a parameter is *not* set, its default value will be used,
  4603. unless there is an environment variable of the same name, in which case
  4604. the value of that environment variable will be used.  This rule
  4605. increases run-time flexibility: an application programmer may allow
  4606. non-critical driver parameters to be specified by the user via
  4607. environment variables.  Once set, a parameter may be unset by the
  4608. programmer by calling `parampl' with a value argument of NULL.  This
  4609. further increases flexibility.
  4610.  
  4611. 
  4612. File: plotutils.info,  Node: C Compiling and Linking,  Next: Sample C Drawings,  Prev: The C API,  Up: C Programming
  4613.  
  4614. C compiling and linking
  4615. -----------------------
  4616.  
  4617.    The source code for a graphics application written in C, if it is to
  4618. use `libplot', must contain the lines
  4619.  
  4620.      #include <stdio.h>
  4621.      #include <plot.h>
  4622.  
  4623. The header file `plot.h' is distributed with `libplot', and should have
  4624. been installed on your system where your C compiler will find it.
  4625. It contains prototypes for each of the functions in `libplot' and some
  4626. miscellaneous definitions.  It may be used with C++ programs as well as
  4627. C programs.
  4628.  
  4629.    To link your application with `libplot', you would use the
  4630. appropriate `-l' option(s) on the command line when compiling it.  You
  4631. would use
  4632.  
  4633.      -lplot -lXaw -lXmu -lXt -lXext -lX11 -lm
  4634.  
  4635. or, in recent versions of the X Window System,
  4636.  
  4637.      -lplot -lXaw -lXmu -lXt -lSM -lICE -lXext -lX11 -lm
  4638.  
  4639. (Alternatively, you may need to use `-lplot -lXm -lXt -lXext -lX11
  4640. -lm', `-lplot -lXm -lXt -lXext -lX11 -lm -lc -lgen', or `-lplot -lXm
  4641. -lXt -lXext -lX11 -lm -lc -lPW', on systems that provide Motif widgets
  4642. instead of Athena widgets.  In recent versions of the X Window System,
  4643. you may need to insert `-lXp' and `-lSM -lICE' also.)
  4644.  
  4645.    On most systems `libplot' is installed as a DLL (dynamically linked
  4646. library, or `shared' library).  This means that the linking with your
  4647. application will take place at run time rather than compile time.  The
  4648. environment variable `LD_LIBRARY_PATH' lists the directories which will
  4649. be searched for DLL's at run time.  For your application to be
  4650. executable, this environment variable should include the directory in
  4651. which `libplot' is stored.
  4652.  
  4653. 
  4654. File: plotutils.info,  Node: Sample C Drawings,  Next: Sample C Animations,  Prev: C Compiling and Linking,  Up: C Programming
  4655.  
  4656. Sample drawings in C
  4657. --------------------
  4658.  
  4659.    The following is a sample application, written in C, that invokes
  4660. `libplot' operations to draw vector graphics.  It draws an intricate
  4661. and beautiful path (Bill Gosper's "C" curve, discussed as Item #135 in
  4662. `HAKMEM', MIT Artificial Intelligence Laboratory Memo #239, 1972).
  4663. As the numeric constant `MAXORDER' (here equal to 12) is increased, the
  4664. path will take on the shape of a curly letter "C", which is the
  4665. envelope of a myriad of epicyclic octagons.
  4666.  
  4667.      #include <stdio.h>
  4668.      #include <plot.h>
  4669.      #define MAXORDER 12
  4670.      
  4671.      void draw_c_curve (double dx, double dy, int order)
  4672.      {
  4673.        if (order >= MAXORDER)
  4674.          fcontrel (dx, dy);        /* continue path along (dx, dy) */
  4675.        else
  4676.          {
  4677.            draw_c_curve (0.5 * (dx - dy), 0.5 * (dx + dy), order + 1);
  4678.            draw_c_curve (0.5 * (dx + dy), 0.5 * (dy - dx), order + 1);
  4679.          }
  4680.      }
  4681.      
  4682.      int main ()
  4683.      {
  4684.        int handle;
  4685.      
  4686.        /* set a Plotter parameter */
  4687.        parampl ("PAGESIZE", "letter");
  4688.      
  4689.        /* create a Postscript Plotter that writes to standard output */
  4690.        if ((handle = newpl ("ps", stdin, stdout, stderr)) < 0)
  4691.          {
  4692.            fprintf (stderr, "Couldn't create Plotter\n");
  4693.            return 1;
  4694.          }
  4695.        selectpl (handle);          /* select the Plotter for use */
  4696.      
  4697.        if (openpl () < 0)          /* open Plotter */
  4698.          {
  4699.            fprintf (stderr, "Couldn't open Plotter\n");
  4700.            return 1;
  4701.          }
  4702.        fspace (0.0, 0.0, 1000.0, 1000.0); /* specify user coordinate system*/
  4703.        flinewidth (0.25);          /* width of lines in user coordinates */
  4704.        pencolorname ("red");       /* path will be drawn in red */
  4705.        erase ();                   /* erase Plotter's graphics display */
  4706.        fmove (600.0, 300.0);       /* position the graphics cursor */
  4707.        draw_c_curve (0.0, 400.0, 0);
  4708.        if (closepl () < 0)         /* close Plotter */
  4709.          {
  4710.            fprintf (stderr, "Couldn't close Plotter\n");
  4711.            return 1;
  4712.          }
  4713.      
  4714.        selectpl (0);               /* select default Plotter */
  4715.        if (deletepl (handle) < 0)  /* delete Plotter we used */
  4716.          {
  4717.            fprintf (stderr, "Couldn't delete Plotter\n");
  4718.            return 1;
  4719.          }
  4720.        return 0;
  4721.      }
  4722.  
  4723.    As you can see, this application begins by calling the `newpl'
  4724. function to create a Postscript Plotter.  The Postscript Plotter will
  4725. produce output for a US letter-sized page, though any other standard
  4726. page size, e.g., "a4", could be substituted.  This would be arranged by
  4727. altering the call to `parampl'.  The `PAGESIZE' parameter is one of
  4728. several Plotter parameters that an application programmer may set by
  4729. calling `parampl'.  For a complete list, see *Note Driver Parameters::.
  4730.  
  4731.    After the Plotter is created, the application selects it for use,
  4732. opens it, and draws the "C" curve recursively.  The drawing of the
  4733. curve is accomplished by invoking `fmove' on the Plotter to position
  4734. the graphics cursor, and then calling `draw_c_curve'.  This subroutine
  4735. repeatedly invokes `fcontrel'.  The `fcontrel' operation continues a
  4736. path by adding a line segment to it.  The endpoint of each line segment
  4737. is specified in relative coordinates, i.e., as an offset from the
  4738. previous point.  After the "C" curve is drawn, the Plotter is closed.
  4739. A Postscript file is written to standard output when `deletepl' is
  4740. called to delete the Plotter.
  4741.  
  4742.    Specifying "fig", "hpgl", "tek", or "meta" as the first argument in
  4743. the call to `newpl', instead of "ps", would yield a Plotter that would
  4744. write graphics to standard output in the specified format, instead of
  4745. Postscript.  The `PAGESIZE' parameter is relevant to the first two of
  4746. these output formats, but is ignored for the latter two.  Specifying
  4747. "meta" as the Plotter type may be useful if you wish to avoid
  4748. recompilation for different output devices.  Metafile output may be
  4749. piped to the `plot' utility and converted to any other supported output
  4750. format, or displayed in an X window.  *Note plot::.
  4751.  
  4752.    If "X" were specified as the first argument of `newpl', the curve
  4753. would be drawn in a popped-up X window, and the output stream argument
  4754. would be ignored.  Which X Window System display the window would
  4755. pop up on would be determined by the `DISPLAY' parameter, or if that
  4756. parameter were not set, by the `DISPLAY' environment variable.  The
  4757. size of the X window would be determined by the `BITMAPSIZE' parameter,
  4758. or if that parameter were not set, by the `BITMAPSIZE' environment
  4759. variable.  The default value is "570x570".
  4760.  
  4761.    You could also specify "Xdrawable" as the Plotter type.  For you to
  4762. make this work, you would need to know a bit about X Window System
  4763. programming.  You would need to create at least one X drawable (i.e.,
  4764. window or a pixmap), and by invoking the `parampl' function before
  4765. `newpl' is called, set it as the value of the parameter
  4766. `XDRAWABLE_DRAWABLE1' or `XDRAWABLE_DRAWABLE2'.  For other parameters
  4767. that affect X Drawable Plotters, see *Note Driver Parameters::.
  4768.  
  4769.    The following is another sample application, written in C, that
  4770. invokes `libplot' operations to draw vector graphics.  It draws a
  4771. spiral consisting of elliptically boxed text strings, each of which
  4772. reads "GNU libplot!".  This figure will be sent to standard output in
  4773. Postscript format.
  4774.  
  4775.      #include <stdio.h>
  4776.      #include <plot.h>
  4777.      #include <math.h>
  4778.      #define SIZE 100.0   /* nominal size of user coordinate frame */
  4779.      #define EXPAND 2.2   /* expansion factor for elliptical box */
  4780.      
  4781.      void draw_boxed_string (char *s, double size, double angle)
  4782.      {
  4783.        double true_size, width;
  4784.      
  4785.        ftextangle (angle);            /* text inclination angle (degrees) */
  4786.        true_size = ffontsize (size);  /* choose font size */
  4787.        width = flabelwidth (s);       /* compute width of text string */
  4788.        fellipserel (0.0, 0.0,         /* draw surrounding ellipse */
  4789.                     EXPAND * 0.5 * width, EXPAND * 0.5 * true_size, angle);
  4790.        alabel ('c', 'c', s);          /* draw centered text string */
  4791.      }
  4792.      
  4793.      int main()
  4794.      {
  4795.        int handle, i;
  4796.      
  4797.        /* set a Plotter parameter */
  4798.        parampl ("PAGESIZE", "letter");
  4799.      
  4800.        /* create a Postscript Plotter that writes to standard output */
  4801.        if ((handle = newpl ("ps", stdin, stdout, stderr)) < 0)
  4802.          {
  4803.            fprintf (stderr, "Couldn't create Plotter\n");
  4804.            return 1;
  4805.          }
  4806.        selectpl (handle);            /* select the Plotter for use */
  4807.      
  4808.        if (openpl () < 0)            /* open Plotter */
  4809.          {
  4810.            fprintf (stderr, "Couldn't open Plotter\n");
  4811.            return 1;
  4812.          }
  4813.        fspace (-(SIZE), -(SIZE), SIZE, SIZE); /* specify user coor system */
  4814.        pencolorname ("blue");        /* pen color will be blue */
  4815.        fillcolorname ("white");
  4816.        filltype (1);                 /* ellipses will be filled with white */
  4817.        fontname ("NewCenturySchlbk-Roman");  /* choose a Postscript font */
  4818.      
  4819.        for (i = 80; i > 1; i--)      /* loop through angles */
  4820.          {
  4821.            double theta, radius;
  4822.      
  4823.            theta = 0.5 * (double)i;  /* theta is in radians */
  4824.            radius = SIZE / pow (theta, 0.35);  /* this yields a spiral */
  4825.            fmove (radius * cos (theta), radius * sin (theta));
  4826.            draw_boxed_string ("GNU libplot!", 0.04 * radius,
  4827.                                (180.0 * theta / M_PI) - 90.0);
  4828.          }
  4829.      
  4830.        if (closepl () < 0)           /* close Plotter */
  4831.          {
  4832.            fprintf (stderr, "Couldn't close Plotter\n");
  4833.            return 1;
  4834.          }
  4835.        selectpl (0);
  4836.        if (deletepl (handle) < 0)    /* delete Plotter we used */
  4837.          {
  4838.            fprintf (stderr, "Couldn't delete Plotter\n");
  4839.            return 1;
  4840.          }
  4841.        return 0;
  4842.      }
  4843.  
  4844.    This example shows what is involved in plotting a text string or text
  4845. strings.  First, the desired font must be retrieved.  A font is fully
  4846. specified by invoking `fontname', `fontsize', and `textangle', or their
  4847. floating point counterparts `ffontname', `ffontsize', and `ftextangle'.
  4848. Since these three operations may be invoked in any order, each of them
  4849. returns the size of the font that it selects, as a convenience to the
  4850. programmer.  This may differ slightly from the size specified in the
  4851. most recent call to `fontsize' or `ffontsize', since many Plotters have
  4852. only a limited repertory of fonts.  The above example plots each text
  4853. string in the "NewCenturySchlbk-Roman" font, which is available on
  4854. Postscript Plotters.  *Note Text Fonts::.
  4855.  
  4856.    If you replace "ps" by "X" in the call to `newpl', an X Plotter
  4857. rather than a Postscript Plotter will be used, and the spiral will be
  4858. drawn in a popped-up X window.  If your X display does not support the
  4859. "NewCenturySchlbk-Roman" font, you may substitute any other scalable
  4860. font, such as the widely available "utopia-medium-r-normal".  For the
  4861. format of font names, see *Note Text Fonts in X::.  If the X Plotter is
  4862. unable to retrieve the font you specify, it will first attempt to use a
  4863. default scalable font ("Helvetica"), and if that fails, use a default
  4864. Hershey vector font ("HersheySerif") instead.  Hershey fonts are
  4865. constructed from line segments, so each built-in Hershey font is
  4866. available on all types of Plotter.
  4867.  
  4868.    If you are using an older (pre-X11R6) X Window System display, you
  4869. will find that retrieving a scalable font is a time-consuming operation.
  4870. The above example may run slowly on some older X displays, since a new
  4871. font must be retrieved before each text string is drawn.  That is
  4872. because each text string has a different angle of inclination.  It is
  4873. possible to retrieve individual characters from an X11R6 display,
  4874. rather than retrieving an entire rasterized font.  If this feature is
  4875. available, the X Plotter will automatically take advantage of it to
  4876. save time.
  4877.  
  4878. 
  4879. File: plotutils.info,  Node: Sample C Animations,  Next: X Programming,  Prev: Sample C Drawings,  Up: C Programming
  4880.  
  4881. Sample animations in C
  4882. ----------------------
  4883.  
  4884.    You may use `libplot' to produce vector graphics animations on any
  4885. Plotter that does real-time plotting (i.e., an X, X Drawable,
  4886. Tektronix, or Metafile Plotter).  By definition, the `frames' in any
  4887. page of graphics are separated by invocations of `erase'.  So the
  4888. graphics display will be cleared after each frame.  If successive
  4889. frames differ only slightly, a smooth animation will result.
  4890.  
  4891.    The following is a sample application, written in C, that produces
  4892. an animation for the X Window System.  It displays a `drifting eye'.
  4893. As the eye drifts across a popped-up window from left to right, it
  4894. slowly rotates.  After the eye has drifted across twice, the window
  4895. will vanish.
  4896.  
  4897.      #include <stdio.h>
  4898.      #include <plot.h>
  4899.      
  4900.      int main ()
  4901.      {
  4902.        int handle, i = 0, j;
  4903.      
  4904.        /* set Plotter parameters */
  4905.        parampl ("BITMAPSIZE", "300x150");
  4906.        parampl ("VANISH_ON_DELETE", "yes");
  4907.        parampl ("USE_DOUBLE_BUFFERING", "yes");
  4908.      
  4909.        /* create an X Plotter with the specified parameters */
  4910.        if ((handle = newpl ("X", stdin, stdout, stderr)) < 0)
  4911.          {
  4912.            fprintf (stderr, "Couldn't create Plotter\n");
  4913.            return 1;
  4914.          }
  4915.        selectpl (handle);          /* select the Plotter for use */
  4916.      
  4917.        if (openpl () < 0)          /* open Plotter */
  4918.          {
  4919.            fprintf (stderr, "Couldn't open Plotter\n");
  4920.            return 1;
  4921.          }
  4922.        space (0, 0, 299, 149);     /* specify user coordinate system */
  4923.        linewidth (8);              /* width of lines in user coordinates */
  4924.        filltype (1);               /* objects will be filled */
  4925.        bgcolorname ("saddle brown");  /* background color for the window */
  4926.        for (j = 0; j < 300; j++)
  4927.          {
  4928.            erase ();               /* erase window */
  4929.            pencolorname ("red");   /* choose red pen, with cyan filling */
  4930.            fillcolorname ("cyan");
  4931.            ellipse (i, 75, 35, 50, i);  /* draw an ellipse */
  4932.            colorname ("black");    /* choose black pen, with black filling */
  4933.            circle (i, 75, 12);     /* draw a circle [the pupil] */
  4934.            i = (i + 2) % 300;      /* shift rightwards */
  4935.          }
  4936.        if (closepl () < 0)         /* close Plotter */
  4937.          {
  4938.            fprintf (stderr, "Couldn't close Plotter\n");
  4939.            return 1;
  4940.          }
  4941.      
  4942.        selectpl (0);               /* select default Plotter */
  4943.        if (deletepl (handle) < 0)  /* delete Plotter we used */
  4944.          {
  4945.            fprintf (stderr, "Couldn't delete Plotter\n");
  4946.            return 1;
  4947.          }
  4948.        return 0;
  4949.      }
  4950.  
  4951.    As you can see, this application begins by calling `parampl' several
  4952. times to set device driver parameters, and then calls `newpl' to create
  4953. an X Plotter.  The X Plotter window will have size 300x150 pixels.
  4954. This window will vanish when the Plotter is deleted.  If the
  4955. `VANISH_ON_DELETE' parameter were not set to "yes", the window would
  4956. remain on the screen until removed by the user (by typing `q' in it, or
  4957. by clicking with a mouse).
  4958.  
  4959.    Setting the parameter `USE_DOUBLE_BUFFERING' to "yes" is very
  4960. important if you wish to produce a smooth animation, with no jerkiness.
  4961. Normally, an X Plotter draws graphics into a window in real time, and
  4962. erases the window when `erase' is called.  But if double buffering is
  4963. used, each frame of graphics is written into an off-screen buffer, and
  4964. copied into the window, pixel by pixel, when `erase' is called or the
  4965. Plotter is closed.  This is a bit counterintuitive, but is exactly what
  4966. is needed for smooth animation.  On some high-end display devices you
  4967. may be able to do even better, by specifying "fast" rather than "yes".
  4968. This requests that the X Plotter take advantage of special hardware
  4969. support for double buffering.  If no such support is available, "fast"
  4970. means the same as "yes".
  4971.  
  4972.    After the Plotter is created, it is selected for use and opened.
  4973. When `openpl' is called, the window pops up, and the animation begins.
  4974. In the body of the for loop there is a call to `erase', and also a
  4975. sequence of `libplot' operations that draws the eye.  The pen color and
  4976. fill color are changed twice with each passage through the loop.  You
  4977. may wish to experiment with the animation parameters to produce the
  4978. best effects on your video hardware.
  4979.  
  4980.    The locations of the objects that are plotted in the animation are
  4981. expressed in terms of user coordinates, not pixel coordinates.  But the
  4982. call to `space' defines user and pixel coordinates to be effectively
  4983. the same.  User coordinates are chosen so that the lower left corner is
  4984. (0,0) and the upper right corner is (299,149).  Since this agrees with
  4985. the window size, individual pixels may be addressed in terms of integer
  4986. user coordinates.  For example, `point(299,149)' would set the pixel in
  4987. the upper right hand corner of the window to the current pen color.
  4988.  
  4989.    The following is another sample animation, this time of a rotating
  4990. letter `A'.
  4991.  
  4992.      #include <stdio.h>
  4993.      #include <plot.h>
  4994.      
  4995.      int main()
  4996.      {
  4997.        int handle, angle = 0;
  4998.      
  4999.        /* set Plotter parameters */
  5000.        parampl ("BITMAPSIZE", "300x300");
  5001.        parampl ("BG_COLOR", "blue"); /* background color for window */
  5002.        parampl ("USE_DOUBLE_BUFFERING", "yes");
  5003.      
  5004.        /* create an X Plotter with the specified parameters */
  5005.        handle = newpl ("X", stdin, stdout, stderr);
  5006.        selectpl (handle);
  5007.      
  5008.        /* open X Plotter, initialize coordinates, pen, and font */
  5009.        openpl ();
  5010.        fspace (0.0, 0.0, 1.0, 1.0);  /* use normalized coordinates */
  5011.        pencolorname ("white");
  5012.        ffontsize (1.0);
  5013.        fontname ("NewCenturySchlbk-Roman");
  5014.      
  5015.        fmove (.50,.50);              /* move to center */
  5016.        while (1)                     /* loop endlessly */
  5017.          {
  5018.            erase ();
  5019.            textangle (angle++);      /* set new rotation angle */
  5020.            alabel ('c', 'c', "A");   /* draw a centered `A' */
  5021.          }
  5022.        closepl();                    /* close Plotter */
  5023.      
  5024.        selectpl (0);                 /* select default Plotter */
  5025.        deletepl (handle);            /* delete Plotter we used */
  5026.        return 0;
  5027.      }
  5028.  
  5029.    This animation serves as a good test of the capabilities of an
  5030. X Window System display.  On a modern X11R6 display, animation will be
  5031. smooth and fast.  That is because X11R6 displays can rasterize
  5032. individual characters from a font without rasterizing the entire font.
  5033. If your X display does not support the "NewCenturySchlbk-Roman" font,
  5034. you may substitute any other scalable font, such as the widely
  5035. available "utopia-medium-r-normal".  For the format of font names, see
  5036. *Note Text Fonts in X::.  If the X Plotter is unable to retrieve the
  5037. font you specify, it will first attempt to use a default scalable font
  5038. ("Helvetica").  If that too fails, it will use a default Hershey vector
  5039. font ("HersheySerif") instead.
  5040.  
  5041.    Animations that use Hershey fonts are normally faster than ones that
  5042. use Postscript fonts or other X Window System fonts, since the Hershey
  5043. fonts are constructed from line segments.  Rasterizing line segments can
  5044. be done rapidly.  But if you use a scalable font such as
  5045. "NewCenturySchlbk-Roman" or "utopia-medium-r-normal", you will notice
  5046. that the rotation speeds up after the letter `A' has rotated through
  5047. 360 degrees.  That is because the `A' at angles past 360 degrees has
  5048. already been rasterized.
  5049.  
  5050. 
  5051. File: plotutils.info,  Node: X Programming,  Prev: Sample C Animations,  Up: C Programming
  5052.  
  5053. Advanced X Window System programming
  5054. ------------------------------------
  5055.  
  5056.    Applications that run under the X Window System are normally built
  5057. using Xt, the X Toolkit.  In Xt, an application is constructed from
  5058. `widgets' such as text entry fields, buttons, sliders, drawing areas,
  5059. etc.  When the application starts up, each widget is configured to
  5060. respond appropriately to `events', which include key presses and mouse
  5061. clicks.  After the widgets are configured, control is transferred to the
  5062. Xt event loop.
  5063.  
  5064.    GNU `libplot' can be used within the Xt event loop to draw vector
  5065. graphics.  For this, it would use one or more X Drawable Plotters.  An
  5066. X Drawable Plotter is a Plotter that can plot into an off-screen pixmap
  5067. or an on-screen window, such as a window associated with a widget.
  5068.  
  5069.    The following sample application shows how an X Drawable Plotter
  5070. would be used.  The application draws a `C' curve, as defined in a
  5071. previous section, in a popped-up window.  The usual Xt command-line
  5072. options may be used: the window background color is specified with the
  5073. "-bg" option, the window geometry with "-geometry", etc.  The curve is
  5074. initially drawn in red, but clicking once with the mouse will redraw it
  5075. in green.  A second mouse click will redraw it in red, and so forth.
  5076. The application will terminate when `q' is typed.
  5077.  
  5078.      #include <stdio.h>
  5079.      #include <plot.h>
  5080.      #include <X11/Xlib.h>
  5081.      #include <X11/Intrinsic.h>
  5082.      #include <X11/Shell.h>
  5083.      #include <X11/StringDefs.h>
  5084.      #include <X11/Core.h>
  5085.      
  5086.      int green = 0;                  /* draw in green, not red? */
  5087.      
  5088.      #define MAXORDER 12
  5089.      void draw_c_curve (double dx, double dy, int order)
  5090.      {
  5091.        if (order >= MAXORDER)
  5092.          fcontrel (dx, dy);          /* continue path along (dx, dy) */
  5093.        else
  5094.          {
  5095.            draw_c_curve (0.5 * (dx - dy), 0.5 * (dx + dy), order + 1);
  5096.            draw_c_curve (0.5 * (dx + dy), 0.5 * (dy - dx), order + 1);
  5097.          }
  5098.      }
  5099.      
  5100.      void Redraw (Widget w, XEvent *ev, String *params, Cardinal *n_params)
  5101.      {
  5102.        /* draw C curve */
  5103.        erase ();
  5104.        pencolorname (green ? "green" : "red");
  5105.        fmove (600.0, 300.0);
  5106.        draw_c_curve (0.0, 400.0, 0);
  5107.        endpath ();
  5108.      }
  5109.      
  5110.      void Toggle (Widget w, XEvent *ev, String *params, Cardinal *n_params)
  5111.      {
  5112.        green = (green ? 0 : 1);
  5113.        Redraw (w, ev, params, n_params);
  5114.      }
  5115.      
  5116.      void Quit (Widget w, XEvent *ev, String *params, Cardinal *n_params)
  5117.      {
  5118.        exit (0);
  5119.      }
  5120.      
  5121.      /* mapping of events to actions */
  5122.      static const String translations =
  5123.      "<Expose>:      redraw()\n\
  5124.      <Btn1Down>:     toggle()\n\
  5125.      <Key>q:         quit()";
  5126.      
  5127.      /* mapping of actions to subroutines */
  5128.      static XtActionsRec actions[] =
  5129.      {
  5130.        {"redraw",            Redraw},
  5131.        {"toggle",            Toggle},
  5132.        {"quit",              Quit},
  5133.      };
  5134.      
  5135.      /* default parameters for widgets */
  5136.      static String default_resources[] =
  5137.      {
  5138.        "Example*geometry:      250x250",
  5139.        (String)NULL
  5140.      };
  5141.      
  5142.      int main (int argc, char *argv[])
  5143.      {
  5144.        Arg wargs[10];                /* storage of widget args */
  5145.        Display *display;             /* X display */
  5146.        Widget shell, canvas;         /* toplevel widget; child */
  5147.        Window window;                /* child widget's window */
  5148.        XtAppContext app_con;         /* application context */
  5149.        int handle, i;
  5150.        char *bg_colorname = "white";
  5151.      
  5152.        /* take background color from command line */
  5153.        for (i = 0; i < argc - 1; i++)
  5154.          if (strcmp (argv[i], "-bg") == 0)
  5155.            bg_colorname = argv[i + 1];
  5156.      
  5157.        /* create toplevel shell widget */
  5158.        shell = XtAppInitialize (&app_con,
  5159.                                 (String)"Example", /* app class */
  5160.                                 NULL,              /* options */
  5161.                                 (Cardinal)0,       /* num of options */
  5162.                                 &argc,             /* command line */
  5163.                                 argv,              /* command line */
  5164.                                 default_resources,
  5165.                                 NULL,              /* ArgList */
  5166.                                 (Cardinal)0        /* num of Args */
  5167.                                 );
  5168.      
  5169.        /* set default widget parameters (including window size) */
  5170.        XtAppSetFallbackResources (app_con, default_resources);
  5171.      
  5172.        /* map actions to subroutines */
  5173.        XtAppAddActions (app_con, actions, XtNumber (actions));
  5174.      
  5175.        /* create canvas widget as child of shell widget; realize both */
  5176.        XtSetArg(wargs[0], XtNargc, argc);
  5177.        XtSetArg(wargs[1], XtNargv, argv);
  5178.        canvas = XtCreateManagedWidget ((String)"", coreWidgetClass,
  5179.                                        shell, wargs, (Cardinal)2);
  5180.        XtRealizeWidget (shell);
  5181.      
  5182.        /* for the canvas widget, map events to actions */
  5183.        XtSetArg (wargs[0], XtNtranslations,
  5184.                  XtParseTranslationTable (translations));
  5185.        XtSetValues (canvas, wargs, (Cardinal)1);
  5186.      
  5187.        /* initialize GNU libplot */
  5188.        display = XtDisplay (canvas);
  5189.        parampl ("XDRAWABLE_DISPLAY", display);
  5190.        window = XtWindow (canvas);
  5191.        parampl ("XDRAWABLE_DRAWABLE1", &window);
  5192.        parampl ("BG_COLOR", bg_colorname);
  5193.        handle = newpl ("Xdrawable", NULL, NULL, stderr);
  5194.        selectpl (handle);
  5195.        openpl ();
  5196.        fspace (0.0, 0.0, 1000.0, 1000.0);
  5197.        flinewidth (0.25);
  5198.      
  5199.        /* transfer control to X Toolkit event loop (doesn't return) */
  5200.        XtAppMainLoop (app_con);
  5201.      
  5202.        return 1;
  5203.      }
  5204.  
  5205.    Even if you are not familiar with X Window System programming, the
  5206. structure of this application should be clear.  It defines three
  5207. callbacks: `Redraw', `Toggle', and `Quit'.  They are invoked
  5208. respectively in response to (1) a window expose event or mouse click,
  5209. (2) a mouse click, and (3) a typed `q'.  The first drawing of the
  5210. `C' curve (in red) takes place because the window receives an initial
  5211. expose event.
  5212.  
  5213.    This example could be extended to take window resizing into account.
  5214. Actually, X Drawable Plotters are usually used to draw vector graphics
  5215. in off-screen pixmaps rather than on-screen windows.  Pixmaps, unlike
  5216. windows, are never resized.
  5217.  
  5218. 
  5219. File: plotutils.info,  Node: Functions,  Next: Driver Parameters,  Prev: C Programming,  Up: libplot
  5220.  
  5221. The functions in `libplot': A detailed listing
  5222. ==============================================
  5223.  
  5224.    In the current release of GNU `libplot', any Plotter supports 81
  5225. distinct operations.  A language binding for `libplot' necessarily
  5226. includes 81 functions that correspond to these operations.  A language
  5227. binding may also include functions for creating, selecting, and
  5228. deleting Plotters.  For example, the C binding includes the four
  5229. additional functions `newpl', `selectpl', `deletepl', and `parampl'.
  5230. *Note The C API::.
  5231.  
  5232.    The 81 functions that operate on a specified Plotter are divided into
  5233. the four sets tabulated below.
  5234.  
  5235.    Many functions come in two versions: integer and double precision
  5236. floating point.  Internally, `libplot' uses double precision floating
  5237. point.  The integer versions are provided for backward compatibility.
  5238. If there are two versions of a function, the name of the floating point
  5239. version begins with the letter `f'.
  5240.  
  5241.    Many functions come in both absolute and relative versions, also.
  5242. The latter use relative coordinates (i.e., coordinates relative to the
  5243. current position of the graphics cursor), and in the C binding their
  5244. names end in `rel'.
  5245.  
  5246.    Currently, only a few of the 81 functions have meaningful return
  5247. values.
  5248.  
  5249. * Menu:
  5250.  
  5251. * Setup Functions::     Functions that open, initialize or close a Plotter
  5252. * Drawing Functions::   Functions that draw objects
  5253. * Attribute Functions:: Functions that affect drawing attributes
  5254. * Mapping Functions::   Functions affecting the user -> device coordinate map
  5255.  
  5256. 
  5257. File: plotutils.info,  Node: Setup Functions,  Next: Drawing Functions,  Prev: Functions,  Up: Functions
  5258.  
  5259. Setup functions
  5260. ---------------
  5261.  
  5262.    The following are the "setup functions" in the C binding for
  5263. `libplot'.  They are the basic functions that open, initialize, or
  5264. close an already-created Plotter.  They are listed in the approximate
  5265. order in which they would be called.
  5266.  
  5267. int openpl ();
  5268.      openpl opens a Plotter, i.e., begins a page of graphics.  This
  5269.      resets the Plotter's drawing attributes to their default values.
  5270.      A negative return value indicates the Plotter could not be opened.
  5271.  
  5272.      Currently, an X Plotter pops up a new window on an X Window System
  5273.      display for each page of graphics, i.e., with each invocation of
  5274.      `openpl'.  Future releases may support window re-use.
  5275.  
  5276. int bgcolor (int RED, int GREEN, int BLUE);
  5277.      bgcolor sets the background color for the Plotter's graphics
  5278.      display, using a 48-bit RGB color model.  The arguments RED, GREEN
  5279.      and BLUE specify the red, green and blue intensities of the
  5280.      background color.  Each is an integer in the range
  5281.      0x0000...0xffff, i.e., 0...65535.  The choice (0, 0, 0) signifies
  5282.      black, and the choice (65535, 65535, 65535) signifies white.
  5283.  
  5284.      bgcolor has an effect only on X Plotters and X Drawable Plotters.
  5285.      Its effect is simple: the next time the erase operation is invoked
  5286.      on such a Plotter, its display will be filled with the specified
  5287.      color.
  5288.  
  5289. int bgcolorname (const char *NAME);
  5290.      bgcolorname sets the background color for the the graphics display
  5291.      to be NAME.  For information on what color names are recognized,
  5292.      see *Note Color Names::.  Unrecognized colors are interpreted as
  5293.      "white".
  5294.  
  5295.      bgcolorname has an effect only on X Plotters and X Drawable
  5296.      Plotters.  Its effect is simple: the next time the erase operation
  5297.      is invoked on such a Plotter, its display will be filled with the
  5298.      specified color.
  5299.  
  5300. int erase ();
  5301.      erase begins the next frame of a multiframe page, by clearing all
  5302.      previously plotted objects from the graphics display, and filling
  5303.      it with the background color (if any).
  5304.  
  5305.      It is frequently useful to invoke erase at the beginning of each
  5306.      page, i.e., immediately after invoking openpl.  That is because
  5307.      some Plotters are persistent, in the sense that objects drawn
  5308.      within an `openpl'...`closepl' pair remain on the graphics display
  5309.      even after a new page is begun by a subsequent invocation of
  5310.      `openpl'.  Currently, only X Drawable Plotters and Tektronix
  5311.      Plotters are persistent.  Future releases may support optional
  5312.      persistence for X Plotters also.
  5313.  
  5314.      On X Plotters and X Drawable Plotters the effects of invoking erase
  5315.      will be altogether different if the device driver parameter
  5316.      `USE_DOUBLE_BUFFERING' is set to "yes".  In this case, objects
  5317.      will be written to an off-screen buffer rather than to the graphics
  5318.      display, and invoking erase will (1) copy the contents of this
  5319.      buffer to the display, and (2) erase the buffer by filling it with
  5320.      the background color.  This feature facilitates smooth animation.
  5321.      *Note Driver Parameters::.
  5322.  
  5323. int space (int X0, int Y0, int X1, int Y1);
  5324. int fspace (double X0, double Y0, double X1, double Y1);
  5325.      space and fspace take two pairs of arguments, specifying the
  5326.      positions of the lower left corner and upper right corner of the
  5327.      graphics display, in user coordinates.  In other words, calling
  5328.      space or fspace sets the affine transformation from user
  5329.      coordinates to device coordinates.  One of these operations must be
  5330.      performed at the beginning of each page of graphics, i.e.,
  5331.      immediately after openpl is invoked.
  5332.  
  5333. int space2 (int X0, int Y0, int X1, int Y1, int X2, int Y2);
  5334. int fspace2 (double X0, double Y0, double X1, double Y1, double X2, double Y2);
  5335.      space2 and fspace2 are extended versions of space and fspace, and
  5336.      may be used instead.  Their arguments are the three defining
  5337.      vertices of an `affine window' (a drawing parallelogram), in user
  5338.      coordinates.  The specified vertices are the lower left, the lower
  5339.      right, and the upper left.  This window will be mapped affinely
  5340.      onto the graphics display.
  5341.  
  5342. int havecap (const char *S);
  5343.      havecap tests whether or not a Plotter, which need not be open, has
  5344.      a specified capability.  The return value is 0, 1, or 2,
  5345.      signifying no/yes/maybe.  For unrecognized capabilities the return
  5346.      value is zero.  Recognized capabilities include "SOLID_FILL",
  5347.      "WIDE_LINES" (i.e., the ability to draw lines with a non-default
  5348.      width), and "SETTABLE_BACKGROUND" (the ability to set the color of
  5349.      the background).  They also include "HERSHEY_FONTS", "PS_FONTS",
  5350.      and "PCL_FONTS", which indicate whether or not fonts of a
  5351.      particular class are supported.  *Note Text Fonts::.
  5352.  
  5353.      The `maybe' value is returned for most capabilities by Metafile
  5354.      Plotters, since they do no drawing themselves.  The output of a
  5355.      Metafile Plotter must be translated to another format, or
  5356.      displayed, by invoking `plot'.
  5357.  
  5358. int flushpl ();
  5359.      flushpl flushes (i.e., pushes onward) all plotting commands to the
  5360.      display device.  This is useful only if the currently selected
  5361.      Plotter does real-time plotting, since it may be used to ensure
  5362.      that all previously plotted objects have been sent to the display
  5363.      and are visible to the user.  It has no effect on Plotters that do
  5364.      not do real-time plotting.
  5365.  
  5366. int closepl ();
  5367.      closepl closes a Plotter, i.e., ends a page of graphics.
  5368.      A negative return value indicates the Plotter could not be closed.
  5369.  
  5370.      In general, Plotters that do not do real-time plotting (i.e.,
  5371.      Postscript, Fig, and HP-GL Plotters) wait until they are deleted
  5372.      before outputing their page(s) of graphics.  However, HP-GL
  5373.      Plotters in the present release of `libplot' output pages of
  5374.      graphics individually.
  5375.  
  5376. FILE *outfile (FILE *FP);
  5377.      outfile, which must be called outside a openpl...closepl pair,
  5378.      redirects all graphics output from a Plotter to the stream FP.
  5379.      The previous output stream is returned.
  5380.  
  5381.      This operation is useful on Plotters that are designed to be
  5382.      opened only once; in particular, on Fig Plotters.  On other
  5383.      Plotters its use is strongly deprecated.  On Plotters that do not
  5384.      have an output stream in the conventional sense, i.e., on
  5385.      X Plotters and X Drawable Plotters, it has no effect.
  5386.  
  5387. 
  5388. File: plotutils.info,  Node: Drawing Functions,  Next: Attribute Functions,  Prev: Setup Functions,  Up: Functions
  5389.  
  5390. Object-drawing functions
  5391. ------------------------
  5392.  
  5393.    The following are the "drawing functions" in the C binding for
  5394. `libplot'.  When invoked on a Plotter, these functions cause it to draw
  5395. objects (paths, circles, ellipses, points, markers, and text strings)
  5396. on the associated graphics display.  A *path* is a sequence of line
  5397. segments and arcs (either circular or elliptic).  Paths may be drawn
  5398. incrementally, one line segment or arc at a time.
  5399.  
  5400. int alabel (int HORIZ_JUSTIFY, int VERT_JUSTIFY, const char *S);
  5401.      alabel takes three arguments HORIZ_JUSTIFY, VERT_JUSTIFY, and S,
  5402.      which specify an `adjusted label,' i.e., a justified text string.
  5403.      The path under construction (if any) is ended, and the string S is
  5404.      drawn according to the specified justifications.  If HORIZ_JUSTIFY
  5405.      is equal to `l', `c', or `r', then the string will be drawn with
  5406.      left, center or right justification, relative to the current
  5407.      graphics cursor position.  If VERT_JUSTIFY is equal to `b', `x',
  5408.      `c', or `t', then the bottom, baseline, center or top of the
  5409.      string will be placed even with the current graphics cursor
  5410.      position.  The graphics cursor is moved to the right end of the
  5411.      string if left justification is specified, and to the left end if
  5412.      right justification is specified.
  5413.  
  5414.      The string may contain escape sequences of various sorts (see
  5415.      *Note Text String Format::), though it should not contain line
  5416.      feeds or carriage returns.  In fact it should include only
  5417.      printable characters, from the byte ranges 0x20...0x7e and
  5418.      0xa0...0xff.  The string may be plotted at a nonzero angle, if
  5419.      `textangle' has been called.
  5420.  
  5421. int arc (int XC, int YC, int X0, int Y0, int X1, int Y1);
  5422. int farc (double XC, double YC, double X0, double Y0, double X1, double Y1);
  5423. int arcrel (int XC, int YC, int X0, int Y0, int X1, int Y1);
  5424. int farcrel (double XC, double YC, double X0, double Y0, double X1, double Y1);
  5425.      arc and farc take six arguments specifying the beginning (X0, Y0),
  5426.      end (X1, Y1), and center (XC, YC) of a circular arc.  If the
  5427.      graphics cursor is at (X0, Y0) and a path is under construction,
  5428.      then the arc is added to the path.  Otherwise the current path
  5429.      (if any) is ended, and the arc begins a new path.  In all cases
  5430.      the graphics cursor is moved to (X1, Y1).
  5431.  
  5432.      The direction of the arc (clockwise or counterclockwise) is
  5433.      determined by the convention that the arc, centered at (XC, YC),
  5434.      sweep through an angle of at most 180 degrees.  If the three
  5435.      points appear to be collinear, the direction is taken to be
  5436.      counterclockwise.  If (XC, YC) is not equidistant from (X0, Y0) and
  5437.      (X1, Y1) as it should be, it is corrected by being moved to the
  5438.      closest point on the perpendicular bisector of the line segment
  5439.      joining (X0, Y0) and (X1, Y1).  arcrel and farcrel are similar to
  5440.      `arc' and `farc', but use cursor-relative coordinates.
  5441.  
  5442. int box (int X1, int y1, int X2, int Y2);
  5443. int fbox (double X1, double Y1, double X2, double Y2);
  5444. int boxrel (int X1, int y1, int X2, int Y2);
  5445. int fboxrel (double X1, double y1, double X2, double Y2);
  5446.      box and fbox take four arguments specifying the lower left corner
  5447.      (X1, Y1) and upper right corner (X2, Y2) of a `box', or rectangle.
  5448.      The path under construction (if any) is ended, and the box is
  5449.      drawn as a new path.  This path is also ended, and the graphics
  5450.      cursor is moved to the midpoint of the box.  boxrel and fboxrel
  5451.      are similar to box and fbox, but use cursor-relative coordinates.
  5452.  
  5453. int circle (int XC, int YC, int R);
  5454. int fcircle (double XC, double YC, double R);
  5455. int circlerel (int XC, int YC, int R);
  5456. int fcirclerel (double XC, double YC, double R);
  5457.      circle and fcircle take three arguments specifying the center (XC,
  5458.      YC) and radius (R) of a circle.  The path under construction
  5459.      (if any) is ended, and the circle is drawn.  The graphics cursor
  5460.      is moved to (XC, YC).  circlerel and fcirclerel are similar to
  5461.      circle and fcircle, but use cursor-relative coordinates for XC and
  5462.      YC.
  5463.  
  5464. int cont (int X, int Y);
  5465. int fcont (double X, double Y);
  5466. int contrel (int X, int Y);
  5467. int fcontrel (double X, double Y);
  5468.      cont and fcont take two arguments specifying the coordinates (X,
  5469.      Y) of a point.  If a path is under construction, the line segment
  5470.      from the current graphics cursor position to the point (X, Y) is
  5471.      added to it.  Otherwise the line segment begins a new path.  In
  5472.      all cases the graphics cursor is moved to (X, Y).  contrel and
  5473.      fcontrel are similar to cont and fcont, but use cursor-relative
  5474.      coordinates.
  5475.  
  5476. int ellarc (int XC, int YC, int X0, int Y0, int X1, int Y1);
  5477. int fellarc (double XC, double YC, double X0, double Y0, double X1, double Y1);
  5478. int ellarcrel (int XC, int YC, int X0, int Y0, int X1, int Y1);
  5479. int fellarcrel (double XC, double YC, double X0, double Y0, double X1, double Y1);
  5480.      ellarc and fellarc take six arguments specifying the three points
  5481.      `pc'=(XC,YC), `p0'=(X0,Y0), and `p1'=(X1,Y1) that define a
  5482.      so-called quarter ellipse.  This is an elliptic arc from `p0' to
  5483.      `p1' with center `pc'.  If the graphics cursor is at point `p0'
  5484.      and a path is under construction, the quarter-ellipse is added to
  5485.      it.  Otherwise the path under construction (if any) is ended, and
  5486.      the quarter-ellipse begins a new path.  In all cases the graphics
  5487.      cursor is moved to `p1'.
  5488.  
  5489.      The quarter-ellipse is an affinely transformed version of a quarter
  5490.      circle.  It is drawn so as to have control points `p0', `p1', and
  5491.      `p0'+`p1'-`pc'.  This means that it is tangent at `p0' to the line
  5492.      segment joining `p0' to `p0'+`p1'-`pc', and is tangent at `p1' to
  5493.      the line segment joining `p1' to `p0'+`p1'-`pc'.  So it fits
  5494.      snugly into a triangle with these three control points as
  5495.      vertices.  Notice that the third control point is the reflection of
  5496.      `pc 'through the line joining `p0' and `p1'.  ellarcrel and
  5497.      fellarcrel are similar to ellarc and fellarc, but use
  5498.      cursor-relative coordinates.
  5499.  
  5500. int ellipse (int XC, int YC, int RX, int RY, int ANGLE);
  5501. int fellipse (double XC, double YC, double RX, double RY, double ANGLE);
  5502. int ellipserel (int XC, int YC, int RX, int RY, int ANGLE);
  5503. int fellipserel (double XC, double YC, double RX, double RY, double ANGLE);
  5504.      ellipse and fellipse take five arguments specifying the center
  5505.      (XC, YC) of an ellipse, the lengths of its semiaxes (RX and RY),
  5506.      and the inclination of the first semiaxis in the counterclockwise
  5507.      direction from the x axis in the user coordinate system.  The path
  5508.      under construction (if any) is ended, and the ellipse is drawn.
  5509.      The graphics cursor is moved to (XC, YC).  ellipserel and
  5510.      fellipserel are similar to ellipse and fellipse, but use
  5511.      cursor-relative coordinates.
  5512.  
  5513. int endpath ();
  5514.      endpath terminates the path under construction, if any.  Paths,
  5515.      which are formed by repeated calls to cont or fcont, arc or farc,
  5516.      ellarc or fellarc, and line or fline, are also terminated if any
  5517.      other object is drawn or any path-related drawing attribute is
  5518.      set.  So endpath is almost redundant.  However, if a Plotter plots
  5519.      objects in real time, calling endpath will ensure that a
  5520.      constructed path is drawn on the graphics display without delay.
  5521.  
  5522. int label (const char *S);
  5523.      label takes a single string argument S and draws the text
  5524.      contained in S at the current graphics cursor position.  The text
  5525.      is left justified, and the graphics cursor is moved to the right
  5526.      end of the string.  This function is provided for backward
  5527.      compatibility; the function call label(S) is equivalent to
  5528.      alabel(`l',`x',S).
  5529.  
  5530. int labelwidth (const char *S);
  5531. double flabelwidth (const char *S);
  5532.      labelwidth and flabelwidth compute and return the width of a
  5533.      string in the current font, in the user coordinate system.  The
  5534.      string is not plotted.
  5535.  
  5536. int line (int X1, int Y1, int X2, int Y2);
  5537. int fline (double X1, double y1, double X2, double Y2);
  5538. int linerel (int X1, int y1, int X2, int Y2);
  5539. int flinerel (double X1, double y1, double X2, double Y2);
  5540.      line and fline take four arguments specifying the start point (X1,
  5541.      Y1) and end point (X2, Y2) of a line segment.  If the graphics
  5542.      cursor is at (X1, Y1) and a path is under construction, the line
  5543.      segment is added to it.  Otherwise the path under construction
  5544.      (if any) is ended, and the line segment begins a new path.  In all
  5545.      cases the graphics cursor is moved to (X2, Y2).  linerel and
  5546.      flinerel are similar to line and fline, but use cursor-relative
  5547.      coordinates.
  5548.  
  5549. int marker (int X, int Y, int TYPE, int SIZE);
  5550. int fmarker (double X, double Y, int TYPE, double SIZE);
  5551. int markerrel (int X, int Y, int TYPE, int SIZE);
  5552. int fmarkerrel (double X, double Y, int TYPE, double SIZE);
  5553.      marker and fmarker take four arguments specifying the location
  5554.      (X,Y) of a marker symbol, its type, and its size in user
  5555.      coordinates.  The path under construction (if any) is ended, and
  5556.      the marker symbol is plotted.  The graphics cursor is moved to
  5557.      (X,Y).  markerrel and fmarkerrel are similar to marker and
  5558.      fmarker, but use cursor-relative coordinates for the position
  5559.      (X,Y).
  5560.  
  5561.      Marker symbol types 0 through 31 are taken from a standard set, and
  5562.      marker symbol types 32 and above are interpreted as the index of a
  5563.      character in the current text font.  *Note Marker Symbols::.
  5564.  
  5565. int move (int X, int Y);
  5566. int fmove (double X, double Y);
  5567. int moverel (int X, int Y);
  5568. int fmoverel (double X, double Y);
  5569.      move and fmove take two arguments specifying the coordinates (X,
  5570.      Y) of a point to which the graphics cursor should be moved.  The
  5571.      path under construction (if any) is ended, and the graphics cursor
  5572.      is moved to (X, Y).  This is equivalent to lifting the pen on a
  5573.      plotter and moving it to a new position, without drawing any line.
  5574.      moverel and fmoverel are similar to move and fmove, but use
  5575.      cursor-relative coordinates.
  5576.  
  5577. int point (int X, int Y);
  5578. int fpoint (double X, double Y);
  5579. int pointrel (int X, int Y);
  5580. int fpointrel (double X, double Y);
  5581.      point and fpoint take two arguments specifying the coordinates (X,
  5582.      Y) of a point.  The path under construction (if any) is ended, and
  5583.      the point is plotted.  (A `point' is usually a small solid circle,
  5584.      perhaps the smallest that can be plotted.)  The graphics cursor is
  5585.      moved to (X, Y).  pointrel and fpointrel are similar to point and
  5586.      fpoint, but use cursor-relative coordinates.
  5587.  
  5588. 
  5589. File: plotutils.info,  Node: Attribute Functions,  Next: Mapping Functions,  Prev: Drawing Functions,  Up: Functions
  5590.  
  5591. Attribute-setting functions
  5592. ---------------------------
  5593.  
  5594.    The following are the "attribute functions" in the C binding for
  5595. `libplot'.  When invoked on a Plotter, these functions set its drawing
  5596. attributes, or save them or restore them.  Path-related attributes
  5597. include pen color, fill color, line width, line style, cap style, and
  5598. join style.  Text-related attributes include pen color, font name, font
  5599. size, and text angle.
  5600.  
  5601.    Setting any path-related drawing attribute automatically terminates
  5602. the path under construction (if any), as if the `endpath' operation had
  5603. been invoked.
  5604.  
  5605. int capmod (const char *S);
  5606.      capmod sets the cap mode (i.e., cap style) for all paths
  5607.      subsequently drawn on the graphics display.  Recognized styles are
  5608.      "butt" (the default), "round", and "projecting".  This function
  5609.      has no effect on Tektronix Plotters.  Also, it has no effect on
  5610.      HP-GL Plotters if the parameter `HPGL_VERSION' is set to a value
  5611.      less than "2" (the default).  *Note Driver Parameters::.
  5612.  
  5613. int color (int RED, int GREEN, int BLUE);
  5614.      color is a convenience function.  Calling color is equivalent to
  5615.      calling both pencolor and fillcolor, to set both the the pen color
  5616.      and fill color of all objects subsequently drawn on the graphics
  5617.      display.  Note that the physical fill color depends also on the
  5618.      fill fraction, which is specified by calling filltype.
  5619.  
  5620. int colorname (const char *NAME);
  5621.      colorname is a convenience function.  Calling colorname is
  5622.      equivalent to calling both pencolorname and fillcolorname, to set
  5623.      both the the pen color and fill color of all objects subsequently
  5624.      drawn on the graphics display.  Note that the physical fill color
  5625.      depends also on the fill fraction, which is specified by calling
  5626.      filltype.
  5627.  
  5628. int filltype (int LEVEL);
  5629.      filltype sets the fill fraction for all subsequently drawn objects.
  5630.      A value of 0 for LEVEL indicates that objects should be unfilled,
  5631.      or transparent.  This is the default.  A value in the range
  5632.      0x0001...0xffff, i.e., 1...65535, indicates that objects should be
  5633.      filled.  A value of 1 signifies 100% filling (the fill color will
  5634.      simply be the color specified by calling fillcolor or
  5635.      fillcolorname).  If LEVEL=0xffff, the fill color will be white.
  5636.      Values between 0x0001 and 0xffff are interpreted as specifying a
  5637.      desaturation, or gray level.  For example, 0x8000 specifies 50%
  5638.      filling (the fill color will be intermediate between the color
  5639.      specified by calling fillcolor or fillcolorname, and white).
  5640.  
  5641.      If the object to be filled is a self-intersecting path, the
  5642.      `even-odd rule' will be applied to determine which points are
  5643.      inside, i.e., which of the regions bounded by the path should be
  5644.      filled.  The even-odd rule is explained in the `Postscript
  5645.      Language Reference Manual'.
  5646.  
  5647.      Tektronix Plotters do not support filling, and HP-GL Plotters
  5648.      support filling of arbitrary paths only if the parameter
  5649.      `HPGL_VERSION' is equal to "1.5" or "2" (the default).  (If the
  5650.      version is "1" then only circles and rectangles aligned with the
  5651.      coordinate axes may be filled.)  *Opaque* filling, including white
  5652.      filling, is supported only if the parameter `HPGL_VERSION' is "2"
  5653.      and the parameter `HPGL_OPAQUE_MODE' is "yes" (the default).
  5654.      *Note Driver Parameters::.
  5655.  
  5656. int fillcolor (int RED, int GREEN, int BLUE);
  5657.      fillcolor sets the fill color of all objects subsequently drawn on
  5658.      the graphics display, using a 48-bit RGB color model.  The
  5659.      arguments RED, GREEN and BLUE specify the red, green and blue
  5660.      intensities of the fill color.  Each is an integer in the range
  5661.      0x0000...0xffff, i.e., 0...65535.  The choice (0, 0, 0) signifies
  5662.      black, and the choice (65535, 65535, 65535) signifies white.  Note
  5663.      that the physical fill color depends also on the fill fraction,
  5664.      which is specified by calling filltype.
  5665.  
  5666. int fillcolorname (const char *NAME);
  5667.      fillcolorname sets the fill color of all objects subsequently drawn
  5668.      on the graphics display to be NAME.  For information on what color
  5669.      names are recognized, see *Note Color Names::.  Unrecognized
  5670.      colors are interpreted as "black".  Note that the physical fill
  5671.      color depends also on the fill fraction, which is specified by
  5672.      calling filltype.
  5673.  
  5674. int fontname (const char *FONT_NAME);
  5675. double ffontname (const char *FONT_NAME);
  5676.      fontname and ffontname take a single case-insensitive string
  5677.      argument, FONT_NAME, specifying the name of the font to be used
  5678.      for all text strings subsequently drawn on the graphics display.
  5679.      (The font for plotting strings is fully specified by calling
  5680.      fontname, fontsize, and textangle.)  The default font name depends
  5681.      on the type of Plotter.  It is "Helvetica" for all Plotters except
  5682.      Tektronix and HP-GL Plotters, for which it is "HersheySerif".  If
  5683.      the argument FONT_NAME is NULL or the empty string, or the font is
  5684.      not available, the default font name will be used.  Which fonts are
  5685.      available also depends on the type of Plotter; for a list of all
  5686.      available fonts, see *Note Text Fonts::.  The size of the font in
  5687.      user coordinates is returned.
  5688.  
  5689. int fontsize (int SIZE);
  5690. double ffontsize (double SIZE);
  5691.      fontsize and ffontsize take a single argument, interpreted as the
  5692.      size, in the user coordinate system, of the font to be used for all
  5693.      text strings subsequently drawn on the graphics display.  (The
  5694.      font for plotting strings is fully specified by calling fontname,
  5695.      fontsize, and textangle.)  The size of the font in user
  5696.      coordinates is returned.  A negative value for SIZE sets the size
  5697.      to a default value, which depends on the type of Plotter.
  5698.  
  5699. int joinmod (const char *S);
  5700.      joinmod sets the join mode (i.e., join style) for all paths
  5701.      subsequently drawn on the graphics display.  Recognized styles are
  5702.      "miter" (the default), "round", and "bevel".  This function has no
  5703.      effect on Tektronix Plotters.  Also, it has no effect on HP-GL
  5704.      Plotters if the parameter `HPGL_VERSION' is set to a value less
  5705.      than "2" (the default). *Note Driver Parameters::.
  5706.  
  5707. int linemod (const char *S);
  5708.      linemod sets the linemode (i.e., line style) for all paths,
  5709.      circles, and ellipses subsequently drawn on the graphics display.
  5710.      The supported linemodes are "disconnected", "solid", "dotted",
  5711.      "dotdashed", "shortdashed", and "longdashed".  The final five
  5712.      correspond more or less to the following bit patterns:
  5713.  
  5714.           "solid"             --------------------------------
  5715.           "dotted"            - - - - - - - - - - - - - - - -
  5716.           "dotdashed"         -----------  -  -----------  -
  5717.           "shortdashed"       --------        --------
  5718.           "longdashed"        ------------    ------------
  5719.  
  5720.      For sufficiently wide lines, the distance over which a pattern
  5721.      repeats is scaled proportionately to the line width.
  5722.  
  5723.      A path that is drawn when the linemode is "disconnected" will be
  5724.      rendered as a set of filled circles, each of which has diameter
  5725.      equal to the nominal line width.  One of these circles will be
  5726.      centered on each of the juncture points of the path (i.e., the
  5727.      endpoints of the line segments or arcs from which it is
  5728.      constructed).  Circles and ellipses that are drawn when the
  5729.      linemode is "disconnected" will be invisible.  Disconnected paths,
  5730.      circles, and ellipses are not filled.
  5731.  
  5732. int linewidth (int SIZE);
  5733. int flinewidth (double SIZE);
  5734.      linewidth and flinewidth set the width, in the user coordinate
  5735.      system, of all paths, circles, and ellipses subsequently drawn on
  5736.      the graphics display.  A negative value means that a default width
  5737.      should be used.  This default width depends on the type of
  5738.      Plotter.  The interpretation of zero line width does also (for
  5739.      some types of Plotter, a zero-width line is the thinnest line that
  5740.      can be drawn; for others, a zero-width line is invisible).
  5741.  
  5742.      Tektronix Plotters do not support drawing with other than a default
  5743.      width, and HP-GL Plotters do not support doing so if the parameter
  5744.      `HPGL_VERSION' is set to a value less than "2" (the default; see
  5745.      *Note Driver Parameters::).
  5746.  
  5747. int pencolor (int RED, int GREEN, int BLUE);
  5748.      pencolor sets the pen color of all objects subsequently drawn on
  5749.      the graphics display, using a 48-bit RGB color model.  The
  5750.      arguments RED, GREEN and BLUE specify the red, green and blue
  5751.      intensities of the pen color.  Each is an integer in the range
  5752.      0x0000...0xffff, i.e., 0...65535.  The choice (0, 0, 0) signifies
  5753.      black, and the choice (65535, 65535, 65535) signifies white.
  5754.  
  5755.      HP-GL Plotters support drawing with a white pen only if the value
  5756.      of the parameter `HPGL_VERSION' is "2" (the default), and the
  5757.      value of the parameter `HPGL_OPAQUE_MODE' is "yes" (the default).
  5758.      *Note Driver Parameters::.
  5759.  
  5760. int pencolorname (const char *NAME);
  5761.      pencolorname sets the pen color of all objects subsequently drawn
  5762.      on the graphics display to be NAME.  For information on what color
  5763.      names are recognized, see *Note Color Names::.  Unrecognized
  5764.      colors are interpreted as "black".
  5765.  
  5766.      HP-GL Plotters support drawing with a white pen only if the value
  5767.      of the parameter `HPGL_VERSION' is "2" (the default) and the value
  5768.      of the parameter `HPGL_OPAQUE_MODE' is "yes" (the default).  *Note
  5769.      Driver Parameters::.
  5770.  
  5771. int restorestate ();
  5772.      restorestate pops the current graphics context off the stack of
  5773.      drawing states.  The graphics context consists largely of
  5774.      `libplot''s drawing attributes, which are set by the attribute
  5775.      functions documented in this section.  So popping off the graphics
  5776.      context restores the drawing attributes to values they previously
  5777.      had.  A path under construction is regarded as part of the graphics
  5778.      context.  For this reason, calling restorestate automatically calls
  5779.      endpath to terminate the path under construction, if any.  All
  5780.      graphics contexts on the stack are popped off when `closepl' is
  5781.      called, as if `restorestate' had been called repeatedly.
  5782.  
  5783. int savestate ();
  5784.      savestate pushes the current graphics context onto the stack of
  5785.      drawing states.  The graphics context consists largely of
  5786.      `libplot''s drawing attributes, which are set by the attribute
  5787.      functions documented in this section.  A path under construction,
  5788.      if any, is regarded as part of the graphics context.  That is
  5789.      because paths may be drawn incrementally, one line segment or arc
  5790.      at a time.  When a graphics context is returned to, the path under
  5791.      construction may be continued.
  5792.  
  5793. int textangle (int ANGLE);
  5794. double ftextangle (double ANGLE);
  5795.      textangle and ftextangle take one argument, which specifies the
  5796.      angle in degrees counterclockwise from the x (horizontal) axis in
  5797.      the user coordinate system, for text strings subsequently drawn on
  5798.      the graphics display.  The default angle is zero.  (The font for
  5799.      plotting strings is fully specified by calling fontname, fontsize,
  5800.      and textangle.)  The size of the font for plotting strings, in user
  5801.      coordinates, is returned.
  5802.  
  5803. 
  5804. File: plotutils.info,  Node: Mapping Functions,  Prev: Attribute Functions,  Up: Functions
  5805.  
  5806. Mapping functions
  5807. -----------------
  5808.  
  5809.    The following are the "mapping functions" in the C binding for
  5810. `libplot'.  When invoked on a Plotter, these functions affect the
  5811. affine transformation it employs for mapping from the user coordinate
  5812. system to the device coordinate system.  They may be viewed as
  5813. performing transformations of the user coordinate system.  Their names
  5814. resemble those of the corresponding functions in the Postscript
  5815. language.  For information on how to use them to draw graphics
  5816. efficiently, consult any good book on Postscript programming, or the
  5817. `Postscript Language Reference Manual'.
  5818.  
  5819. int fconcat (double M0, double M1, double M2, double M3, double TX, double TY);
  5820.      Apply a Postscript-style transformation matrix, i.e., affine map,
  5821.      to the user coordinate system.  That is, apply the linear
  5822.      transformation defined by the two-by-two matrix [M0 M1 M2 M3] to
  5823.      the user coordinate system, and also translate by TX units in the
  5824.      x direction and TY units in the y direction, relative to the
  5825.      former user coordinate system.  The following three functions
  5826.      (frotate, fscale, ftranslate) are convenience functions that are
  5827.      special cases of fconcat.
  5828.  
  5829. int frotate (double THETA);
  5830.      Rotate the user coordinate system axes about their origin by THETA
  5831.      degrees, with respect to their former orientation.  The position
  5832.      of the user coordinate origin and the size of the x and y units
  5833.      remain unchanged.
  5834.  
  5835. int fscale (double SX, double SY);
  5836.      Make the x and y units in the user coordinate system be the size
  5837.      of SX and SY units in the former user coordinate system.  The
  5838.      position of the user coordinate origin and the orientation of the
  5839.      coordinate axes are unchanged.
  5840.  
  5841. int ftranslate (double TX, double TY);
  5842.      Move the origin of the user coordinate system by TX units in the
  5843.      x direction and TY units in the y direction, relative to the
  5844.      former user coordinate system.  The size of the x and y units and
  5845.      the orientation of the coordinate axes are unchanged.
  5846.  
  5847. 
  5848. File: plotutils.info,  Node: Driver Parameters,  Prev: Functions,  Up: libplot
  5849.  
  5850. Device driver parameters
  5851. ========================
  5852.  
  5853.    In designing the `libplot' library, every effort was made to make
  5854. the Plotter interface independent of the type of Plotter.  To the
  5855. extent that device dependence exists, it is captured by a manageable
  5856. number of *device driver parameters*.
  5857.  
  5858.    In the C binding, a value for any parameter may be specified by
  5859. calling the `parampl' function.  The `parampl' function does not
  5860. operate on any particular Plotter: it belongs to the C binding as a
  5861. whole.  The parameter values used by any Plotter are constant over the
  5862. lifetime of the Plotter, and are those that were in effect when the
  5863. Plotter was created.  Each driver parameter has a value that is allowed
  5864. to be a generic pointer (a `void *').  For most parameters, this value
  5865. should be a string (a `char *').  `parampl' may be called any number of
  5866. times.  A parameter may be unset by calling `parampl' with a value
  5867. argument of NULL.
  5868.  
  5869.    If at Plotter creation time a parameter is *not* set, its default
  5870. value will be used, unless there is an environment variable of the same
  5871. name, in which case the value of that environment variable will be used.
  5872. This rule increases run-time flexibility: an application programmer may
  5873. allow non-critical driver parameters to be specified by the user via
  5874. environment variables.
  5875.  
  5876.    The following are the currently recognized parameters (unrecognized
  5877. ones are ignored).  The most important ones are `DISPLAY' and
  5878. `BITMAPSIZE', which affect X Plotters, and `PAGESIZE', which affects
  5879. Postscript, Fig, and HP-GL Plotters.  These three parameters are listed
  5880. first and the others alphabetically.  Many of the parameters, such as
  5881. the several whose names begin with "HPGL", affect only a single type of
  5882. Plotter.
  5883.  
  5884. `DISPLAY'
  5885.      (Default NULL.)  The X Window System display on which the graphics
  5886.      display will be popped up, as an X window.  This is relevant only
  5887.      to X Plotters.
  5888.  
  5889. `BITMAPSIZE'
  5890.      (Default "570x570".)  The size of the graphics display in terms of
  5891.      pixels.  This is relevant only to X Plotters.  If this parameter
  5892.      is not set, its value will automatically be taken from the
  5893.      X resource `Xplot.geometry'.  This is for backward compatibility.
  5894.  
  5895. `PAGESIZE'
  5896.      (Default "letter".)  The size of the page on which the graphics
  5897.      display will be positioned.  This is relevant only to Postscript,
  5898.      Fig, and HP-GL Plotters.  "letter" means an 8.5in by 11in page.
  5899.      Any ISO page size in the range "a0"..."a4" or ANSI page size in
  5900.      the range "a"..."e" may be specified ("letter" is an alias for "a"
  5901.      and "tabloid" is an alias for "b").  "legal" and "ledger" are
  5902.      recognized page sizes also.
  5903.  
  5904.      For Postscript Plotters, the graphics display will be a square
  5905.      region centered on the specified page and occupying its full
  5906.      width.  For Fig Plotters, the graphics display will be a square
  5907.      region located in the upper left corner of an `xfig' display, with
  5908.      width equal to the width of the specified page.  For HP-GL
  5909.      Plotters, fine control over the positioning of the graphics
  5910.      display on the page may be accomplished by setting the
  5911.      `HPGL_XOFFSET' and `HPGL_YOFFSET' parameters.
  5912.  
  5913. `BG_COLOR'
  5914.      (Default "white".)  The initial background color of the graphics
  5915.      display, when drawing each page of graphics.  This is relevant to
  5916.      X Plotters and X Drawable Plotters, although for the latter, the
  5917.      background color shows up only if `erase' is invoked.  The
  5918.      background color may be changed at any later time by invoking the
  5919.      bgcolor (or bgcolorname) and erase operations.  An unrecognized
  5920.      color name sets the background color to the default.  For
  5921.      information on what names are recognized, see *Note Color Names::.
  5922.  
  5923. `HPGL_ASSIGN_COLORS'
  5924.      (Default "no".)  Relevant only to HP-GL Plotters, and only if the
  5925.      value of `HPGL_VERSION' is "2".  "no" means to draw with a fixed
  5926.      set of pens, specified by setting the `HPGL_PENS' parameter.  "yes"
  5927.      means that pen colors will not restricted to the palette specified
  5928.      in `HPGL_PENS': colors will be assigned to "logical pens" in the
  5929.      range #1...#31, as needed.  Other than color LaserJet printers and
  5930.      DesignJet plotters, not many HP-GL/2 devices allow the assignment
  5931.      of colors to logical pens.  So this parameter should be used with
  5932.      caution.
  5933.  
  5934. `HPGL_OPAQUE_MODE'
  5935.      (Default "yes".)  Relevant only to HP-GL Plotters, and only if the
  5936.      value of `HPGL_VERSION' is "2".  "yes" means that the HP-GL/2
  5937.      output device should be switched into opaque mode, rather than
  5938.      transparent mode.  This allows objects to be filled with opaque
  5939.      white and other opaque colors.  It also allows the drawing of
  5940.      visible white lines, which by convention are drawn with pen #0.
  5941.      Not all HP-GL/2 devices support opaque mode or the use of pen #0
  5942.      to draw visible white lines.  In particular, HP-GL/2 pen plotters
  5943.      do not.  Some older HP-GL/2 devices reportedly malfunction if
  5944.      asked to switch into opaque mode.  If the output of an HP-GL
  5945.      Plotter is to be sent to such a device, a "no" value is
  5946.      recommended.
  5947.  
  5948. `HPGL_PENS'
  5949.      (Default "1=black:2=red:3=green:4=yellow:5=blue:6=magenta:7=cyan"
  5950.      if the value of `HPGL_VERSION' is "1.5" or "2" and "1=black" if the
  5951.      value of `HPGL_VERSION' is "1".  Relevant only to HP-GL Plotters.
  5952.      The set of available pens; the format should be self-explanatory.
  5953.      The color for any pen in the range #1...#31 may be specified.  For
  5954.      information on what color names are recognized, see *Note Color
  5955.      Names::.  Pen #1 must always be present, though it need not be
  5956.      black.  Any other pen in the range #1...#31 may be omitted.
  5957.  
  5958. `HPGL_ROTATE'
  5959.      (Default "0".)  Relevant only to HP-GL Plotters.  The angle, in
  5960.      degrees, by which the graphics display should be rotated on the
  5961.      page relative to the default orientation.  Recognized values are
  5962.      "0", "90", "180", and "270"; "no" and "yes" are equivalent to
  5963.      "0" and "90" respectively.  This parameter is provided to
  5964.      facilitate switching between portrait and landscape orientations.
  5965.      For HP-GL output devices this is frequently a concern, since some
  5966.      HP-GL devices ("plotters") draw with a default landscape
  5967.      orientation, and others ("printers") draw with a default portrait
  5968.      orientation.  "180" and "270" are supported only if `HPGL_VERSION'
  5969.      is "2".
  5970.  
  5971. `HPGL_VERSION'
  5972.      (Default "2".)  Relevant only to HP-GL Plotters.  "1" means that
  5973.      the output should be generic HP-GL, "1.5" means that the output
  5974.      should be suitable for the HP7550A graphics plotter and the
  5975.      HP758x, HP7595A and HP7596A drafting plotters (HP-GL with some
  5976.      HP-GL/2 extensions), and "2" means that the output should be
  5977.      modern HP-GL/2.  If the version is "1" or "1.5" then the only
  5978.      available fonts will be vector fonts, and all paths will be drawn
  5979.      with a default width.  Additionally, if the version is "1" then
  5980.      the filling of arbitrary paths will not be supported (circles and
  5981.      rectangles aligned with the coordinate axes may be filled).
  5982.  
  5983. `HPGL_XOFFSET'
  5984.      (Default "0.0cm".)  Relevant only to HP-GL Plotters.  An
  5985.      adjustment, in the x direction, of the position of the graphics
  5986.      display on the page.  It may be specified in centimeters,
  5987.      millimeters, or inches.  For example, an offset could be specified
  5988.      as "2cm" or "1.2in".
  5989.  
  5990. `HPGL_YOFFSET'
  5991.      (Default "0.0cm".)  Relevant only to HP-GL Plotters.  An
  5992.      adjustment, in the y direction, of the position of the graphics
  5993.      display on the page.
  5994.  
  5995. `MAX_LINE_LENGTH'
  5996.      (Default "500".)  The maximum number of points that a path may
  5997.      contain, before it is flushed to the display device.  If this
  5998.      flushing occurs, the path will be split into two or more
  5999.      sub-paths, though the splitting should not be noticeable.
  6000.      Splitting will not be performed if the path is filled.
  6001.  
  6002.      This parameter is relevant to X, X Drawable, Postscript, Fig, and
  6003.      HP-GL Plotters.  The reason for splitting long paths is that some
  6004.      display devices (e.g., old Postscript printers and HP-GL plotters)
  6005.      have limited buffer sizes.  It is not relevant to Tektronix or
  6006.      Metafile Plotters, since they draw paths in real time and have no
  6007.      buffer limitations.
  6008.  
  6009. `META_PORTABLE'
  6010.      (Default "no".)  Relevant only to Metafile Plotters.  "yes" means
  6011.      that the output should be in a portable (human-readable) version
  6012.      of the metafile format, rather than the default (binary) version.
  6013.      *Note Metafiles::.
  6014.  
  6015. `TERM'
  6016.      (Default NULL.)  Relevant only to Tektronix Plotters.  If the
  6017.      value is `xterm', `xterms', or `kterm', it is taken as a sign that
  6018.      the current application is running in an X Window System VT100
  6019.      terminal emulator: an `xterm'.  Before drawing graphics, a
  6020.      Tektronix Plotter will emit an escape sequence that causes the
  6021.      terminal emulator's auxiliary Tektronix window, which is normally
  6022.      hidden, to pop up.  After the graphics are drawn, an escape
  6023.      sequence that returns control to the original VT100 window will be
  6024.      emitted.  The Tektronix window will remain on the screen.
  6025.  
  6026.      If the value of is `kermit', `ansi.sys', `ansissys', `ansi.sysk',
  6027.      or `ansisysk', it is taken as a sign that the current application
  6028.      is running in the VT100 terminal emulator provided by the MS-DOS
  6029.      version of `kermit'.  Before drawing graphics, a Tektronix Plotter
  6030.      will emit an escape sequence that switches the terminal emulator
  6031.      to Tektronix mode.  Also, some of the Tektronix control codes
  6032.      emitted by the Plotter will be `kermit'-specific.  There will be a
  6033.      limited amount of color support, which is not normally the case
  6034.      (the 16 `ansi.sys' colors will be supported).  After drawing
  6035.      graphics, the Plotter will emit an escape sequence that returns
  6036.      the emulator to VT100 mode.  The key sequence `ALT minus' may be
  6037.      employed manually within `kermit' to switch between the two modes.
  6038.  
  6039. `USE_DOUBLE_BUFFERING'
  6040.      (Default "no".)  Relevant only to X Plotters and X Drawable
  6041.      Plotters.  If the value is "yes", each frame of graphics, within a
  6042.      openpl...closepl pair, is written to an off-screen buffer rather
  6043.      than to the Plotter's display.  When erase is invoked to end a
  6044.      frame, or when closepl is invoked, the contents of the off-screen
  6045.      buffer are copied to the Plotter's display, pixel by pixel.  This
  6046.      double buffering scheme is useful in creating the illusion of
  6047.      smooth animation.  A value of "fast" rather than "yes" requests
  6048.      that an X Plotter use server-supported double buffering.
  6049.      If "fast" is set, the X Plotter will attempt to use the standard
  6050.      DBE and MBX extensions to the X11 protocol to communicate with the
  6051.      display.  If either of these two options is available, it may
  6052.      yield much faster animation; on high-end graphics hardware,
  6053.      at least.  If the extensions are unavailable, "fast" means the
  6054.      same as "yes".
  6055.  
  6056. `VANISH_ON_DELETE'
  6057.      (Default "no".)  Relevant only to X Plotters.  If the value is
  6058.      "yes", when a Plotter is deleted, the window or windows that it
  6059.      has popped up will vanish.  Otherwise, each such window will
  6060.      remain on the screen until it is removed by the user (by typing
  6061.      `q' in it, or by clicking with a mouse).
  6062.  
  6063. `XDRAWABLE_COLORMAP'
  6064.      (Default NULL.)  Relevant only to X Drawable Plotters.  If the
  6065.      value is non-NULL, it should be a `Colormap *', a pointer to a
  6066.      colormap from which colors should be allocated.  NULL indicates
  6067.      that the colormap to be used should be the default colormap of the
  6068.      default screen of the X display.
  6069.  
  6070. `XDRAWABLE_DISPLAY'
  6071.      (Default NULL.)  Relevant only to X Drawable Plotters.  The value
  6072.      should be a `Display *', a pointer to the X display with which the
  6073.      drawable(s) to be drawn in are associated.
  6074.  
  6075. `XDRAWABLE_DRAWABLE1'
  6076. `XDRAWABLE_DRAWABLE2'
  6077.      (Default NULL.)  Relevant only to X Drawable Plotters.  If set, the
  6078.      value of each of these parameters should be a `Drawable *', a
  6079.      pointer to a drawable to be drawn in.  A `drawable' is either a
  6080.      window or a pixmap.  At the time an X Drawable Plotter is created,
  6081.      at least one of the two parameters must be set.
  6082.  
  6083.      X Drawable Plotters support simultaneous drawing in two drawables
  6084.      because it is often useful to be able to draw graphics
  6085.      simultaneously in both an X window and its background pixmap.  If
  6086.      two drawables are specified, they must have the same dimensions
  6087.      and depth, and be associated with the same screen of the X display.
  6088.  
  6089. 
  6090. File: plotutils.info,  Node: Appendices,  Prev: libplot,  Up: Top
  6091.  
  6092.    The following appendices contain miscellaneous information on the
  6093. GNU plotting utilities.
  6094.  
  6095. * Menu:
  6096.  
  6097. * Text and Markers::    Text fonts, text strings, and marker symbols
  6098. * Color Names::         Specifying colors by name
  6099. * Metafiles::           The device-independent GNU metafile format
  6100. * Auxiliary Software::  How to obtain auxiliary software
  6101. * Acknowledgements::    The Contributors
  6102.  
  6103. 
  6104. File: plotutils.info,  Node: Text and Markers,  Next: Color Names,  Prev: Appendices,  Up: Appendices
  6105.  
  6106. Fonts, Strings, and Symbols
  6107. ***************************
  6108.  
  6109.    The `libplot' vector graphics library and applications built on it,
  6110. such as `graph' and `plot', can draw text strings in a wide variety of
  6111. fonts.  Text strings may include characters from more than one font in
  6112. a typeface, and may include superscripts, subscripts, and square roots.
  6113. A wide variety of plotting symbols can also be drawn.  The following
  6114. sections explain how to use these features.
  6115.  
  6116. * Menu:
  6117.  
  6118. * Text Fonts::          Available text fonts
  6119. * Text Fonts in X::     Available text fonts in the X Window System
  6120. * Text String Format::  Text string formatting (with escape sequences)
  6121. * Marker Symbols::      Available marker symbols
  6122.  
  6123. 
  6124. File: plotutils.info,  Node: Text Fonts,  Next: Text Fonts in X,  Prev: Text and Markers,  Up: Text and Markers
  6125.  
  6126. Available text fonts
  6127. ====================
  6128.  
  6129.    The `libplot' library and applications built on it, such as `graph'
  6130. and `plot', can use many fonts.  These include 22 Hershey vector fonts,
  6131. 35 Postscript fonts, and 45 PCL 5 fonts.  We call these 102 fonts the
  6132. `built-in' fonts.  The Hershey fonts are constructed from stroked
  6133. characters digitized c. 1967 by Dr.  Allen V. Hershey at the U.S. Naval
  6134. Surface Weapons Center in Dahlgren, VA.  The 35 Postscript fonts are
  6135. the outline fonts resident in all modern Postscript printers, and the
  6136. 45 PCL 5 fonts are the outline fonts resident in modern Hewlett-Packard
  6137. LaserJet printers and plotters.  (The old LaserJet III, which was
  6138. Hewlett-Packard's first PCL 5 printer, supported only 8 of the 45.)
  6139.  
  6140.    The Hershey fonts can be used by all types of Plotter supported by
  6141. `libplot', and the Postscript fonts can be used by all types of Plotter
  6142. except HP-GL and Tektronix.  So all variants of `graph' can use the
  6143. Hershey fonts, and all variants of `graph' except `graph -T hpgl' and
  6144. `graph -T tek' can use the Postscript fonts.  The PCL 5 fonts can be
  6145. used by HP-GL Plotters and `graph -T hpgl'.  X Plotters and `graph
  6146. -T X' are not restricted to the built-in fonts.  They can use any
  6147. X Window System font.
  6148.  
  6149.    The `plotfont' utility, which accepts the `-T' option, will print a
  6150. character map of any font that is available on the specified output
  6151. device.  *Note plotfont::.
  6152.  
  6153.    For the purpose of plotting text strings (see *Note Text String
  6154. Format::), the 102 built-in fonts are divided into typefaces.  The 22
  6155. Hershey fonts are divided into typefaces as follows.
  6156.  
  6157.    * HersheySerif
  6158.  
  6159.        1. HersheySerif
  6160.  
  6161.        2. HersheySerif-Italic
  6162.  
  6163.        3. HersheySerif-Bold
  6164.  
  6165.        4. HersheySerif-BoldItalic
  6166.  
  6167.        5. HersheyCyrillic
  6168.  
  6169.        6. HersheyCyrillic-Oblique
  6170.  
  6171.        7. HersheyEUC
  6172.  
  6173.    * HersheySans
  6174.  
  6175.        1. HersheySans
  6176.  
  6177.        2. HersheySans-Oblique
  6178.  
  6179.        3. HersheySans-Bold
  6180.  
  6181.        4. HersheySans-BoldOblique
  6182.  
  6183.    * HersheyScript
  6184.  
  6185.        1. HersheyScript
  6186.  
  6187.        2. HersheyScript
  6188.  
  6189.        3. HersheyScript-Bold
  6190.  
  6191.        4. HersheyScript-Bold
  6192.  
  6193.    * HersheyGothicEnglish
  6194.  
  6195.    * HersheyGothicGerman
  6196.  
  6197.    * HersheyGothicItalian
  6198.  
  6199.    * HersheySerifSymbol
  6200.        1. HersheySerifSymbol
  6201.  
  6202.        2. HersheySerifSymbol-Oblique
  6203.  
  6204.        3. HersheySerifSymbol-Bold
  6205.  
  6206.        4. HersheySerifSymbol-BoldOblique
  6207.  
  6208.    * HersheySansSymbol
  6209.        1. HersheySansSymbol
  6210.  
  6211.        2. HersheySansSymbol-Oblique
  6212.  
  6213. The three HersheyGothic fonts are singletons: each is font #1 of its own
  6214. typeface.  The symbol fonts contain Greek characters and mathematical
  6215. symbols, and play a special role.  By convention, each Hershey typeface
  6216. contains a symbol font (HersheySerifSymbol or HersheySansSymbol, as
  6217. appropriate) as font #0.
  6218.  
  6219.    The 35 Postscript fonts are divided into typefaces as follows.
  6220.  
  6221.    * Helvetica
  6222.  
  6223.        1. Helvetica
  6224.  
  6225.        2. Helvetica-Oblique
  6226.  
  6227.        3. Helvetica-Bold
  6228.  
  6229.        4. Helvetica-BoldOblique
  6230.  
  6231.    * Helvetica-Narrow
  6232.  
  6233.        1. Helvetica-Narrow
  6234.  
  6235.        2. Helvetica-Narrow-Oblique
  6236.  
  6237.        3. Helvetica-Narrow-Bold
  6238.  
  6239.        4. Helvetica-Narrow-BoldOblique
  6240.  
  6241.    * Times
  6242.  
  6243.        1. Times-Roman
  6244.  
  6245.        2. Times-Italic
  6246.  
  6247.        3. Times-Bold
  6248.  
  6249.        4. Times-BoldItalic
  6250.  
  6251.    * AvantGarde
  6252.  
  6253.        1. AvantGarde-Book
  6254.  
  6255.        2. AvantGarde-BookOblique
  6256.  
  6257.        3. AvantGarde-Demi
  6258.  
  6259.        4. AvantGarde-DemiOblique
  6260.  
  6261.    * Bookman
  6262.  
  6263.        1. Bookman-Light
  6264.  
  6265.        2. Bookman-LightItalic
  6266.  
  6267.        3. Bookman-Demi
  6268.  
  6269.        4. Bookman-DemiItalic
  6270.  
  6271.    * Courier
  6272.  
  6273.        1. Courier
  6274.  
  6275.        2. Courier-Oblique
  6276.  
  6277.        3. Courier-Bold
  6278.  
  6279.        4. Courier-BoldOblique
  6280.  
  6281.    * NewCenturySchlbk
  6282.  
  6283.        1. NewCenturySchlbk-Roman
  6284.  
  6285.        2. NewCenturySchlbk-Italic
  6286.  
  6287.        3. NewCenturySchlbk-Bold
  6288.  
  6289.        4. NewCenturySchlbk-BoldItalic
  6290.  
  6291.    * Palatino
  6292.  
  6293.        1. Palatino-Roman
  6294.  
  6295.        2. Palatino-Italic
  6296.  
  6297.        3. Palatino-Bold
  6298.  
  6299.        4. Palatino-BoldItalic
  6300.  
  6301.    * ZapfChancery-MediumItalic
  6302.  
  6303.    * ZapfDingbats
  6304.  
  6305.    * Symbol
  6306.  
  6307. The two Zapf fonts are singletons: each is font #1 of its own typeface.
  6308. The Symbol font plays a special role.  By convention, each Postscript
  6309. typeface contains the Symbol font as font #0.
  6310.  
  6311.    The 45 PCL 5 fonts are divided into typefaces as follows.
  6312.  
  6313.    * Univers
  6314.  
  6315.        1. Univers
  6316.  
  6317.        2. Univers-Oblique
  6318.  
  6319.        3. Univers-Bold
  6320.  
  6321.        4. Univers-BoldOblique
  6322.  
  6323.    * UniversCondensed
  6324.  
  6325.        1. UniversCondensed
  6326.  
  6327.        2. UniversCondensed-Oblique
  6328.  
  6329.        3. UniversCondensed-Bold
  6330.  
  6331.        4. UniversCondensed-BoldOblique
  6332.  
  6333.    * CGTimes
  6334.  
  6335.        1. CGTimes-Roman
  6336.  
  6337.        2. CGTimes-Italic
  6338.  
  6339.        3. CGTimes-Bold
  6340.  
  6341.        4. CGTimes-BoldItalic
  6342.  
  6343.    * Albertus
  6344.  
  6345.        1. AlbertusMedium
  6346.  
  6347.        2. AlbertusMedium
  6348.  
  6349.        3. AlbertusExtraBold
  6350.  
  6351.        4. AlbertusExtraBold
  6352.  
  6353.    * AntiqueOlive
  6354.  
  6355.        1. AntiqueOlive
  6356.  
  6357.        2. AntiqueOlive-Italic
  6358.  
  6359.        3. AntiqueOlive-Bold
  6360.  
  6361.    * Arial
  6362.  
  6363.        1. Arial-Roman
  6364.  
  6365.        2. Arial-Italic
  6366.  
  6367.        3. Arial-Bold
  6368.  
  6369.        4. Arial-BoldItalic
  6370.  
  6371.    * ClarendonCondensed
  6372.  
  6373.    * Coronet
  6374.  
  6375.    * Courier
  6376.  
  6377.        1. Courier
  6378.  
  6379.        2. Courier-Italic
  6380.  
  6381.        3. Courier-Bold
  6382.  
  6383.        4. Courier-BoldItalic
  6384.  
  6385.    * Garamond
  6386.  
  6387.        1. Garamond
  6388.  
  6389.        2. Garamond-Italic
  6390.  
  6391.        3. Garamond-Bold
  6392.  
  6393.        4. Garamond-BoldItalic
  6394.  
  6395.    * LetterGothic
  6396.  
  6397.        1. LetterGothic-Roman
  6398.  
  6399.        2. LetterGothic-Italic
  6400.  
  6401.        3. LetterGothic-Bold
  6402.  
  6403.        4. LetterGothic-BoldItalic
  6404.  
  6405.    * Marigold
  6406.  
  6407.    * CGOmega
  6408.  
  6409.        1. CGOmega-Roman
  6410.  
  6411.        2. CGOmega-Italic
  6412.  
  6413.        3. CGOmega-Bold
  6414.  
  6415.        4. CGOmega-BoldItalic
  6416.  
  6417.    * TimesNewRoman
  6418.  
  6419.        1. TimesNewRoman
  6420.  
  6421.        2. TimesNewRoman-Italic
  6422.  
  6423.        3. TimesNewRoman-Bold
  6424.  
  6425.        4. TimesNewRoman-BoldItalic
  6426.  
  6427.    * Wingdings
  6428.  
  6429.    * Symbol
  6430.  
  6431. The ClarendonCondensed, Coronet, Marigold, and Wingdings fonts are
  6432. singletons: each is font #1 of its own typeface.  The Symbol font plays
  6433. a special role.  By convention, each PCL 5 typeface contains the Symbol
  6434. font as font #0.
  6435.  
  6436.    As you can see from the three preceding tables, our convention is
  6437. that in any typeface with more than a single font, font #1 is the normal
  6438. font, font #2 is italic or oblique, font #3 is bold, and font #4 is bold
  6439. italic or bold oblique.  Additional variants (if any) are numbered #5
  6440. and higher.
  6441.  
  6442.    Of the above 102 built-in fonts, all except for the four Symbol
  6443. fonts, HersheyCyrillic, HersheyCyrillic-Oblique, HersheyEUC,
  6444. ZapfDingbats, and Wingdings are ISO-8859-1 fonts.  This means that they
  6445. use the ISO-Latin-1 encoding, which is a superset of ASCII.  The four
  6446. Symbol fonts use a special encoding, since they consist of Greek
  6447. characters and mathematical symbols.  The Symbol encoding and the
  6448. encoding used by the ZapfDingbats font are documented in the
  6449. `Postscript Language Reference Manual'.
  6450.  
  6451.    The HersheyCyrillic and HersheyCyrillic-Oblique fonts use an encoding
  6452. called KOI8-R, a superset of ASCII which has become the de facto
  6453. standard for Unix and networking applications in the former Soviet
  6454. Union.  Insofar as printable ASCII characters go, they resemble the
  6455. HersheySerif fonts.  But their `8-bit' characters are different.  The
  6456. byte range 0xc0...0xdf contains lower-case Cyrillic characters and the
  6457. byte range 0xe0...0xff contains upper case Cyrillic characters.
  6458. Additional Cyrillic characters are located at 0xa3 and 0xb3.  For more
  6459. on the encoding scheme, see the official KOI8-R Web page (http://www.nagual.pp.ru/~ache/koi8.html) and the document known as Internet RFC
  6460. 1489.
  6461.  
  6462.    The HersheyEUC font is used for displaying Japanese.  EUC stands for
  6463. `extended Unix code', which is a scheme for encoding Japanese, and also
  6464. other character sets (e.g., Greek and Cyrillic) as multibyte character
  6465. strings.  The format of EUC strings is explained in Ken Lunde's
  6466. `Understanding Japanese Information Processing' (O'Reilly, 1993), which
  6467. contains much additional information on Japanese text processing.  See
  6468. also his on-line supplement (http://www.ora.com/people/authors/lunde/cjk_inf.html).
  6469.  
  6470.    In the HersheyEUC font, characters in the printable ASCII range,
  6471. 0x20...0x7e, are similar to US ASCII (they are `JIS Roman', an ASCII
  6472. variant standardized by the Japanese Industrial Standards Committee).
  6473. Each successive pair of bytes in the `0xa1'...`0xfe' range defines a
  6474. single character in the JIS X0208 standard.  The characters in the JIS
  6475. X0208 standard include Japanese syllabic characters (Hiragana and
  6476. Katakana), ideographic characters (Kanji), Roman, Greek, and Cyrillic
  6477. alphabets, punctuation marks, and miscellaneous symbols.  For example,
  6478. the JIS X0208 standard indexes the 83 Hiragana as `0x2421'...`0x2453'.
  6479. To obtain the EUC code for any JIS X0208 character, you would add
  6480. `0x80' to each byte (i.e., `set the high bit' on each byte).  So the
  6481. first of the 83 Hiragana (`0x2421') would be encoded as the successive
  6482. pair of bytes `0xa4' and `0xa1'.
  6483.  
  6484.    The implementation of the JIS X0208 standard in the HersheyEUC font
  6485. is based on Dr. Hershey's digitizations, and is complete enough to be
  6486. useful.  All Hiragana and Katakana are available, though the little-used
  6487. `half-width Katakana' are not supported.  Also, 603 frequently used
  6488. Kanji are available.  The Hiragana, the Katakana, and the available
  6489. Kanji all have the same width.  The file `kanji.doc', which on most
  6490. systems is installed in `/usr/share/libplot' or
  6491. `/usr/local/share/libplot', lists the 603 available Kanji.  Each JIS
  6492. X0208 character that is unavailable will be drawn as an `undefined
  6493. character' glyph (several horizontal lines).
  6494.  
  6495.    To what extent do the fonts supported by `libplot' contain
  6496. ligatures?  The 35 Postscript fonts and 45 PCL 5 fonts, as implemented
  6497. in `libplot', do not contain ligatures.  However, four of the 22
  6498. Hershey fonts contain ligatures.  The character combinations "fi",
  6499. "ff", "fl", "ffi", and "ffl" are automatically drawn as ligatures in
  6500. HersheySerif and HersheySerif-Italic.  (Also in the HersheyCyrillic
  6501. fonts and HersheyEUC, since insofar as printable ASCII characters are
  6502. concerned, they are identical [or almost identical] to HersheySerif.)
  6503. In addition, "tz" and "ch" are ligatures in HersheyGothicGerman.  The
  6504. German double-s character `ss', which is called an `eszet', is not
  6505. treated as a ligature in any font.  To obtain an eszet, you must either
  6506. request one with the escape sequence "\ss" (*note Text String
  6507. Format::.), or, if you have an 8-bit keyboard, type an eszet explicitly.
  6508.  
  6509. 
  6510. File: plotutils.info,  Node: Text Fonts in X,  Next: Text String Format,  Prev: Text Fonts,  Up: Text and Markers
  6511.  
  6512. Available text fonts for the X Window System
  6513. ============================================
  6514.  
  6515.    The plotting utilities `graph -T X' and `plot -T X', and the
  6516. `libplot' library that they are built on, can draw text on an X Window
  6517. System display in a wide variety of fonts.  This includes the 22
  6518. built-in Hershey vector fonts.  They can use the 35 built-in Postscript
  6519. fonts too, if those fonts are available on the X display.  Most
  6520. releases of the plotting utilities include freely distributable
  6521. versions of the 35 Postscript fonts, in Type 1 format, that are easily
  6522. installed on any X display.
  6523.  
  6524.    In fact, the plotting utilities can use most fonts that are
  6525. available on the current X display.  This includes all scalable fonts
  6526. that have a so-called XLFD (X Logical Font Description) name.  For
  6527. example, the "CharterBT-Roman" font is available on many X displays.
  6528. It has a formal XLFD name, namely
  6529. "-bitstream-charter-medium-r-normal-0-0-0-0-p-0-iso8859-1".  The
  6530. plotting utilities would refer to it as "charter-medium-r-normal".  The
  6531. command
  6532.  
  6533.      echo 0 0 1 1 2 0 | graph -T X -F charter-medium-r-normal
  6534.  
  6535. would draw a plot in a popped-up X window, in which all axis ticks are
  6536. labeled in this font.
  6537.  
  6538.    You may determine which fonts are available on an X display by using
  6539. the `xlsfonts' command.  Fonts whose names end in
  6540. "-0-0-0-0-p-0-iso8859-1" or "-0-0-0-0-m-0-iso8859-1" are scalable
  6541. ISO-Latin-1 fonts that can be used by `libplot''s X Plotters and by
  6542. `graph -T X' and `plot -T X'.  The two sorts of font are variable-width
  6543. and fixed-width fonts, respectively.  Fonts whose names end in
  6544. "iso8859-2", etc., and "adobe-fontspecific", may also be used, even
  6545. though they do not employ the standard ISO-Latin-1 encoding.
  6546.  
  6547.    The escape sequences that provide access to the non-ASCII `8-bit'
  6548. characters in the built-in ISO-Latin-1 fonts may be employed when using
  6549. any ISO-Latin-1 X Window System font.  For more on escape sequences,
  6550. see *Note Text String Format::.  As an example, "\Po" will yield the
  6551. British pounds sterling symbol `#'.  The command
  6552.  
  6553.      echo 0 0 1 1 | graph -T X -F charter-medium-r-normal -L "A \Po1 Plot"
  6554.  
  6555. shows how this symbol could be used in a graph label.  In the same way,
  6556. the escape sequences that provide access to mathematical symbols and
  6557. Greek characters may be employed when using any X Window System font,
  6558. whether or not it is an ISO-Latin-1 font.
  6559.  
  6560.    The plotting utilities, including `graph', support a `--bitmap-size'
  6561. option.  It is meaningful only if the `-T X' option is used, since it
  6562. sets the size of the popped-up X Window.  You may use it to obtain some
  6563. interesting visual effects.  `graph' assumes that it is drawing in a
  6564. square region, so if you use the `--bitmap-size 800x400' option, your
  6565. plot will be scaled anisotropically, by a larger factor in the
  6566. horizontal direction than in the vertical direction.  The fonts in the
  6567. plot will be scaled in the same way.  Actually, this requires a modern
  6568. (X11R6) display.  If your X display cannot scale a font, a default
  6569. scalable font (such as "HersheySerif") will be substituted.
  6570.  
  6571. 
  6572. File: plotutils.info,  Node: Text String Format,  Next: Marker Symbols,  Prev: Text Fonts in X,  Up: Text and Markers
  6573.  
  6574. Text string format and escape sequences
  6575. =======================================
  6576.  
  6577.    Text strings that are drawn by `libplot', and by such applications
  6578. as `graph' and `plot' that are built on `libplot', must consist of
  6579. printable characters.  No embedded control characters, such as newlines
  6580. or carriage returns, are allowed.  Technically, a character is
  6581. `printable' if it comes from either of the two byte ranges 0x20...0x7e
  6582. and 0xa0...0xff.  The former is the printable ASCII range and the
  6583. latter is the printable `8-bit' range.
  6584.  
  6585.    Text strings may, however, include embedded `escape sequences' that
  6586. shift the font, append subscripts or superscripts, or include non-ASCII
  6587. characters and mathematical symbols.  As a consequence, the axis labels
  6588. on a plot prepared with `graph' may include such features.
  6589.  
  6590.    The format of the escape sequences should look familiar to anyone
  6591. who is familiar with the TeX or `groff' document formatters.  Each
  6592. escape sequence consists of three characters: a backslash and two
  6593. additional characters.  The most frequently used escape sequences are as
  6594. follows.
  6595.  
  6596. "\sp"
  6597.      start superscript mode
  6598.  
  6599. "\ep"
  6600.      end superscript mode
  6601.  
  6602. "\sb"
  6603.      start subscript mode
  6604.  
  6605. "\eb"
  6606.      end subscript mode
  6607.  
  6608. "\mk"
  6609.      mark location
  6610.  
  6611. "\rt"
  6612.      return to marked location
  6613.  
  6614. For example, the string "x\sp2\ep" would be interpreted as `x squared'.
  6615. Subscripts on subscripts, etc., are allowed.  Subscripts and
  6616. superscripts may be vertically aligned by judicious use of the "\mk" and
  6617. "\rt" escape sequences.  For example, "a\mk\sbi\eb\rt\sp2\ep" produces
  6618. "a sub i squared", with the exponent `2' placed immediately above the
  6619. subscript.
  6620.  
  6621.    There are also escape sequences that switch from font to font within
  6622. a typeface.  For an enumeration of the fonts within each typeface, see
  6623. *Note Text Fonts::.  Suppose for example that the current font is
  6624. Times-Roman, which is font #1 in the `Times' typeface.  The string "A
  6625. \f2very\f1 well labeled axis" would be a string in which the word `very'
  6626. appears in Times-Italic rather than Times-Roman.  That is because
  6627. Times-Italic is the #2 font in the typeface.  Font-switching escape
  6628. sequences are of the form "\fN", where N is the number of the font to
  6629. be switched to, in the current font.  There is currently no support for
  6630. switching between fonts in different typefaces.
  6631.  
  6632.    There are also a few escape sequences for horizontal shifts, which
  6633. are useful for improving horizontal alignment, such as when shifting
  6634. between fonts.  "\r1", "\r2", "\r4", "\r6", "\r8" are escape sequences
  6635. that shift right by 1 em, 1/2 em, 1/4 em, 1/6 em, and 1/8 em,
  6636. respectively.  "\l1", "\l2", "\l4", "\l6", "\l8" are similar, but shift
  6637. left instead of right.  "A \f2very\r8\f1 well labeled axis" would look
  6638. better than "A \f2very\f1 well labeled axis".
  6639.  
  6640.    Square roots are handled with the aid of a special pair of escape
  6641. sequences, together with the "\mk" and "\rt" sequences discussed above.
  6642. A square root symbol is begun with "\sr", and continued arbitrarily far
  6643. to the right with the overbar (`run') escape sequence, "\rn".  For
  6644. example, the string "\sr\mk\rn\rn\rtab" would be plotted as `the square
  6645. root of ab'.  To adjust the length of the overbar, you may need to
  6646. experiment with the number of times "\rn" appears.
  6647.  
  6648.    To underline a string, you would use "\ul", the underline escape
  6649. sequence, one or more times.  The "\mk"..."\rt" trick would be employed
  6650. in the same way.  So, for example, "\mk\ul\ul\ul\rtabc" would yield an
  6651. underlined "abc".  To adjust the length of the underline, you may need
  6652. to experiment with the number of times "\ul" appears.  You may also
  6653. need to use one or more of the abovementioned horizontal shifts.  For
  6654. example, if the "HersheySerif" font were used, "\mk\ul\ul\l8\ul\rtabc"
  6655. would yield a better underline than "\mk\ul\ul\ul\rtabc".
  6656.  
  6657.    Besides the preceding escape sequences, there are also escape
  6658. sequences for the printable non-ASCII characters in each of the built-in
  6659. ISO-Latin-1 fonts (which means in every built-in font, except for the
  6660. symbol fonts, the HersheyCyrillic fonts, HersheyEUC, and ZapfDingbats).
  6661. The useful non-ASCII characters include accented characters among
  6662. others.  Such `8-bit' characters, in the 0xa0...0xff byte range, may be
  6663. included directly in a text string.  But if your terminal does not
  6664. permit this, you may use the escape sequences for them instead.
  6665.  
  6666.    There are escape sequences for the mathematical symbols and Greek
  6667. characters in the symbol fonts, as well.  This is how the symbol fonts
  6668. are usually accessed.  Which symbol font the mathematical symbols and
  6669. Greek characters are taken from depends on whether your current font is
  6670. a Hershey font or a non-Hershey font.  They are taken from the
  6671. HersheySerifSymbol font or the HersheySansSymbol font in the former
  6672. case, and from the Symbol font in the latter.
  6673.  
  6674.    The following are the escape sequences that provide access to the
  6675. non-ASCII characters of the current font, provided that it is an
  6676. ISO-Latin-1 font.  Each escape sequence is followed by the position of
  6677. the corresponding character in the ISO-Latin-1 encoding (in decimal),
  6678. and the official Postscript name of the character.  Most names should be
  6679. self-explanatory.  For example, `eacute' is a lower-case `e', equipped
  6680. with an acute accent.
  6681.  
  6682. "\r!"
  6683.      [161] exclamdown
  6684.  
  6685. "\ct"
  6686.      [162] cent
  6687.  
  6688. "\Po"
  6689.      [163] sterling
  6690.  
  6691. "\Cs"
  6692.      [164] currency
  6693.  
  6694. "\Ye"
  6695.      [165] yen
  6696.  
  6697. "\bb"
  6698.      [166] brokenbar
  6699.  
  6700. "\sc"
  6701.      [167] section
  6702.  
  6703. "\ad"
  6704.      [168] dieresis
  6705.  
  6706. "\co"
  6707.      [169] copyright
  6708.  
  6709. "\Of"
  6710.      [170] ordfeminine
  6711.  
  6712. "\Fo"
  6713.      [171] guillemotleft
  6714.  
  6715. "\no"
  6716.      [172] logicalnot
  6717.  
  6718. "\hy"
  6719.      [173] hyphen
  6720.  
  6721. "\rg"
  6722.      [174] registered
  6723.  
  6724. "\a-"
  6725.      [175] macron
  6726.  
  6727. "\de"
  6728.      [176] degree
  6729.  
  6730. "\+-"
  6731.      [177] plusminus
  6732.  
  6733. "\S2"
  6734.      [178] twosuperior
  6735.  
  6736. "\S3"
  6737.      [179] threesuperior
  6738.  
  6739. "\aa"
  6740.      [180] acute
  6741.  
  6742. "\*m"
  6743.      [181] mu
  6744.  
  6745. "\ps"
  6746.      [182] paragraph
  6747.  
  6748. "\md"
  6749.      [183] periodcentered
  6750.  
  6751. "\ac"
  6752.      [184] cedilla
  6753.  
  6754. "\S1"
  6755.      [185] onesuperior
  6756.  
  6757. "\Om"
  6758.      [186] ordmasculine
  6759.  
  6760. "\Fc"
  6761.      [187] guillemotright
  6762.  
  6763. "\14"
  6764.      [188] onequarter
  6765.  
  6766. "\12"
  6767.      [189] onehalf
  6768.  
  6769. "\34"
  6770.      [190] threequarters
  6771.  
  6772. "\r?"
  6773.      [191] questiondown
  6774.  
  6775. "\`A"
  6776.      [192] Agrave
  6777.  
  6778. "\'A"
  6779.      [193] Aacute
  6780.  
  6781. "\^A"
  6782.      [194] Acircumflex
  6783.  
  6784. "\~A"
  6785.      [195] Atilde
  6786.  
  6787. "\:A"
  6788.      [196] Adieresis
  6789.  
  6790. "\oA"
  6791.      [197] Aring
  6792.  
  6793. "\AE"
  6794.      [198] AE
  6795.  
  6796. "\,C"
  6797.      [199] Ccedilla
  6798.  
  6799. "\`E"
  6800.      [200] Egrave
  6801.  
  6802. "\'E"
  6803.      [201] Eacute
  6804.  
  6805. "\^E"
  6806.      [202] Ecircumflex
  6807.  
  6808. "\:E"
  6809.      [203] Edieresis
  6810.  
  6811. "\`I"
  6812.      [204] Igrave
  6813.  
  6814. "\'I"
  6815.      [205] Iacute
  6816.  
  6817. "\^I"
  6818.      [206] Icircumflex
  6819.  
  6820. "\:I"
  6821.      [207] Idieresis
  6822.  
  6823. "\-D"
  6824.      [208] Eth
  6825.  
  6826. "\~N"
  6827.      [209] Ntilde
  6828.  
  6829. "\'O"
  6830.      [210] Ograve
  6831.  
  6832. "\'O"
  6833.      [211] Oacute
  6834.  
  6835. "\^O"
  6836.      [212] Ocircumflex
  6837.  
  6838. "\~O"
  6839.      [213] Otilde
  6840.  
  6841. "\:O"
  6842.      [214] Odieresis
  6843.  
  6844. "\mu"
  6845.      [215] multiply
  6846.  
  6847. "\/O"
  6848.      [216] Oslash
  6849.  
  6850. "\`U"
  6851.      [217] Ugrave
  6852.  
  6853. "\'U"
  6854.      [218] Uacute
  6855.  
  6856. "\^U"
  6857.      [219] Ucircumflex
  6858.  
  6859. "\:U"
  6860.      [220] Udieresis
  6861.  
  6862. "\'Y"
  6863.      [221] Yacute
  6864.  
  6865. "\TP"
  6866.      [222] Thorn
  6867.  
  6868. "\ss"
  6869.      [223] germandbls
  6870.  
  6871. "\`a"
  6872.      [224] agrave
  6873.  
  6874. "\'a"
  6875.      [225] aacute
  6876.  
  6877. "\^a"
  6878.      [226] acircumflex
  6879.  
  6880. "\~a"
  6881.      [227] atilde
  6882.  
  6883. "\:a"
  6884.      [228] adieresis
  6885.  
  6886. "\oa"
  6887.      [229] aring
  6888.  
  6889. "\ae"
  6890.      [230] ae
  6891.  
  6892. "\,c"
  6893.      [231] ccedilla
  6894.  
  6895. "\`e"
  6896.      [232] egrave
  6897.  
  6898. "\'e"
  6899.      [233] eacute
  6900.  
  6901. "\^e"
  6902.      [234] ecircumflex
  6903.  
  6904. "\:e"
  6905.      [235] edieresis
  6906.  
  6907. "\`i"
  6908.      [236] igrave
  6909.  
  6910. "\'i"
  6911.      [237] iacute
  6912.  
  6913. "\^i"
  6914.      [238] icircumflex
  6915.  
  6916. "\:i"
  6917.      [239] idieresis
  6918.  
  6919. "\Sd"
  6920.      [240] eth
  6921.  
  6922. "\~n"
  6923.      [241] ntilde
  6924.  
  6925. "\`o"
  6926.      [242] ograve
  6927.  
  6928. "\'o"
  6929.      [243] oacute
  6930.  
  6931. "\^o"
  6932.      [244] ocircumflex
  6933.  
  6934. "\~o"
  6935.      [245] otilde
  6936.  
  6937. "\:o"
  6938.      [246] odieresis
  6939.  
  6940. "\di"
  6941.      [247] divide
  6942.  
  6943. "\/o"
  6944.      [248] oslash
  6945.  
  6946. "\`u"
  6947.      [249] ugrave
  6948.  
  6949. "\'u"
  6950.      [250] uacute
  6951.  
  6952. "\^u"
  6953.      [251] ucircumflex
  6954.  
  6955. "\:u"
  6956.      [252] udieresis
  6957.  
  6958. "\'y"
  6959.      [253] yacute
  6960.  
  6961. "\Tp"
  6962.      [254] thorn
  6963.  
  6964. "\:y"
  6965.      [255] ydieresis
  6966.  
  6967.    The following are the escape sequences that provide access to
  6968. mathematical symbols and Greek characters in the current symbol font,
  6969. whether HersheySerifSymbol or HersheySansSymbol (for Hershey fonts) or
  6970. Symbol (for Postscript fonts).  Each escape sequence is followed by the
  6971. position (in octal) of the corresponding character in the symbol
  6972. encoding, and the official Postscript name of the character.  Many
  6973. escape sequences and names should be self-explanatory.  "\*a" represents
  6974. a lower-case Greek alpha, for example.  For a table displaying each of
  6975. the characters below, see the `Postscript Language Reference Manual'.
  6976.  
  6977. "\fa"
  6978.      [0042] universal
  6979.  
  6980. "\te"
  6981.      [0044] existential
  6982.  
  6983. "\st"
  6984.      [0047] suchthat
  6985.  
  6986. "\**"
  6987.      [0052] asteriskmath
  6988.  
  6989. "\=~"
  6990.      [0100] congruent
  6991.  
  6992. "\*A"
  6993.      [0101] Alpha
  6994.  
  6995. "\*B"
  6996.      [0102] Beta
  6997.  
  6998. "\*X"
  6999.      [0103] Chi
  7000.  
  7001. "\*D"
  7002.      [0104] Delta
  7003.  
  7004. "\*E"
  7005.      [0105] Epsilon
  7006.  
  7007. "\*F"
  7008.      [0106] Phi
  7009.  
  7010. "\*G"
  7011.      [0107] Gamma
  7012.  
  7013. "\*Y"
  7014.      [0110] Eta
  7015.  
  7016. "\*I"
  7017.      [0111] Iota
  7018.  
  7019. "\+h"
  7020.      [0112] theta1
  7021.  
  7022. "\*K"
  7023.      [0113] Kappa
  7024.  
  7025. "\*L"
  7026.      [0114] Lambda
  7027.  
  7028. "\*M"
  7029.      [0115] Mu
  7030.  
  7031. "\*N"
  7032.      [0116] Nu
  7033.  
  7034. "\*O"
  7035.      [0117] Omicron
  7036.  
  7037. "\*P"
  7038.      [0120] Pi
  7039.  
  7040. "\*H"
  7041.      [0121] Theta
  7042.  
  7043. "\*R"
  7044.      [0122] Rho
  7045.  
  7046. "\*S"
  7047.      [0123] Sigma
  7048.  
  7049. "\*T"
  7050.      [0124] Tau
  7051.  
  7052. "\*U"
  7053.      [0125] Upsilon
  7054.  
  7055. "\ts"
  7056.      [0126] sigma1
  7057.  
  7058. "\*W"
  7059.      [0127] Omega
  7060.  
  7061. "\*C"
  7062.      [0130] Xi
  7063.  
  7064. "\*Q"
  7065.      [0131] Psi
  7066.  
  7067. "\*Z"
  7068.      [0132] Zeta
  7069.  
  7070. "\tf"
  7071.      [0134] therefore
  7072.  
  7073. "\pp"
  7074.      [0136] perpendicular
  7075.  
  7076. "\ul"
  7077.      [0137] underline
  7078.  
  7079. "\rx"
  7080.      [0140] radicalex
  7081.  
  7082. "\*a"
  7083.      [0141] alpha
  7084.  
  7085. "\*b"
  7086.      [0142] beta
  7087.  
  7088. "\*x"
  7089.      [0143] chi
  7090.  
  7091. "\*d"
  7092.      [0144] delta
  7093.  
  7094. "\*e"
  7095.      [0145] epsilon
  7096.  
  7097. "\*f"
  7098.      [0146] phi
  7099.  
  7100. "\*g"
  7101.      [0147] gamma
  7102.  
  7103. "\*y"
  7104.      [0150] eta
  7105.  
  7106. "\*i"
  7107.      [0151] iota
  7108.  
  7109. "\+f"
  7110.      [0152] phi1
  7111.  
  7112. "\*k"
  7113.      [0153] kappa
  7114.  
  7115. "\*l"
  7116.      [0154] lambda
  7117.  
  7118. "\*m"
  7119.      [0155] mu
  7120.  
  7121. "\*n"
  7122.      [0156] nu
  7123.  
  7124. "\*o"
  7125.      [0157] omicron
  7126.  
  7127. "\*p"
  7128.      [0160] pi
  7129.  
  7130. "\*h"
  7131.      [0161] theta
  7132.  
  7133. "\*r"
  7134.      [0162] rho
  7135.  
  7136. "\*s"
  7137.      [0163] sigma
  7138.  
  7139. "\*t"
  7140.      [0164] tau
  7141.  
  7142. "\*u"
  7143.      [0165] upsilon
  7144.  
  7145. "\+p"
  7146.      [0166] omega1
  7147.  
  7148. "\*w"
  7149.      [0167] omega
  7150.  
  7151. "\*c"
  7152.      [0170] xi
  7153.  
  7154. "\*q"
  7155.      [0171] psi
  7156.  
  7157. "\*z"
  7158.      [0172] zeta
  7159.  
  7160. "\ap"
  7161.      [0176] similar
  7162.  
  7163. "\+U"
  7164.      [0241] Upsilon1
  7165.  
  7166. "\fm"
  7167.      [0242] minute
  7168.  
  7169. "\<="
  7170.      [0243] lessequal
  7171.  
  7172. "\f/"
  7173.      [0244] fraction
  7174.  
  7175. "\if"
  7176.      [0245] infinity
  7177.  
  7178. "\Fn"
  7179.      [0246] florin
  7180.  
  7181. "\CL"
  7182.      [0247] club
  7183.  
  7184. "\DI"
  7185.      [0250] diamond
  7186.  
  7187. "\HE"
  7188.      [0251] heart
  7189.  
  7190. "\SP"
  7191.      [0252] spade
  7192.  
  7193. "\<>"
  7194.      [0253] arrowboth
  7195.  
  7196. "\<-"
  7197.      [0254] arrowleft
  7198.  
  7199. "\ua"
  7200.      [0255] arrowup
  7201.  
  7202. "\->"
  7203.      [0256] arrowright
  7204.  
  7205. "\da"
  7206.      [0257] arrowdown
  7207.  
  7208. "\de"
  7209.      [0260] degree
  7210.  
  7211. "\+-"
  7212.      [0261] plusminus
  7213.  
  7214. "\sd"
  7215.      [0262] second
  7216.  
  7217. "\>="
  7218.      [0263] greaterequal
  7219.  
  7220. "\mu"
  7221.      [0264] multiply
  7222.  
  7223. "\pt"
  7224.      [0265] proportional
  7225.  
  7226. "\pd"
  7227.      [0266] partialdiff
  7228.  
  7229. "\bu"
  7230.      [0267] bullet
  7231.  
  7232. "\di"
  7233.      [0270] divide
  7234.  
  7235. "\!="
  7236.      [0271] notequal
  7237.  
  7238. "\=="
  7239.      [0272] equivalence
  7240.  
  7241. "\~~"
  7242.      [0273] approxequal
  7243.  
  7244. "\.."
  7245.      [0274] ellipsis
  7246.  
  7247. NONE
  7248.      [0275] arrowvertex
  7249.  
  7250. "\an"
  7251.      [0276] arrowhorizex
  7252.  
  7253. "\CR"
  7254.      [0277] carriagereturn
  7255.  
  7256. "\Ah"
  7257.      [0300] aleph
  7258.  
  7259. "\Im"
  7260.      [0301] Ifraktur
  7261.  
  7262. "\Re"
  7263.      [0302] Rfraktur
  7264.  
  7265. "\wp"
  7266.      [0303] weierstrass
  7267.  
  7268. "\c*"
  7269.      [0304] circlemultiply
  7270.  
  7271. "\c+"
  7272.      [0305] circleplus
  7273.  
  7274. "\es"
  7275.      [0306] emptyset
  7276.  
  7277. "\ca"
  7278.      [0307] cap
  7279.  
  7280. "\cu"
  7281.      [0310] cup
  7282.  
  7283. "\SS"
  7284.      [0311] superset
  7285.  
  7286. "\ip"
  7287.      [0312] reflexsuperset
  7288.  
  7289. "\n<"
  7290.      [0313] notsubset
  7291.  
  7292. "\SB"
  7293.      [0314] subset
  7294.  
  7295. "\ib"
  7296.      [0315] reflexsubset
  7297.  
  7298. "\mo"
  7299.      [0316] element
  7300.  
  7301. "\nm"
  7302.      [0317] notelement
  7303.  
  7304. "\/_"
  7305.      [0320] angle
  7306.  
  7307. "\gr"
  7308.      [0321] nabla
  7309.  
  7310. "\rg"
  7311.      [0322] registerserif
  7312.  
  7313. "\co"
  7314.      [0323] copyrightserif
  7315.  
  7316. "\tm"
  7317.      [0324] trademarkserif
  7318.  
  7319. "\PR"
  7320.      [0325] product
  7321.  
  7322. "\sr"
  7323.      [0326] radical
  7324.  
  7325. "\md"
  7326.      [0327] dotmath
  7327.  
  7328. "\no"
  7329.      [0330] logicalnot
  7330.  
  7331. "\AN"
  7332.      [0331] logicaland
  7333.  
  7334. "\OR"
  7335.      [0332] logicalor
  7336.  
  7337. "\hA"
  7338.      [0333] arrowdblboth
  7339.  
  7340. "\lA"
  7341.      [0334] arrowdblleft
  7342.  
  7343. "\uA"
  7344.      [0335] arrowdblup
  7345.  
  7346. "\rA"
  7347.      [0336] arrowdblright
  7348.  
  7349. "\dA"
  7350.      [0337] arrowdbldown
  7351.  
  7352. "\lz"
  7353.      [0340] lozenge
  7354.  
  7355. "\la"
  7356.      [0341] angleleft
  7357.  
  7358. "\RG"
  7359.      [0342] registersans
  7360.  
  7361. "\CO"
  7362.      [0343] copyrightsans
  7363.  
  7364. "\TM"
  7365.      [0344] trademarksans
  7366.  
  7367. "\SU"
  7368.      [0345] summation
  7369.  
  7370. NONE
  7371.      [0346] parenlefttp
  7372.  
  7373. NONE
  7374.      [0347] parenleftex
  7375.  
  7376. NONE
  7377.      [0350] parenleftbt
  7378.  
  7379. "\lc"
  7380.      [0351] bracketlefttp
  7381.  
  7382. NONE
  7383.      [0352] bracketleftex
  7384.  
  7385. "\lf"
  7386.      [0353] bracketleftbt
  7387.  
  7388. "\lt"
  7389.      [0354] bracelefttp
  7390.  
  7391. "\lk"
  7392.      [0355] braceleftmid
  7393.  
  7394. "\lb"
  7395.      [0356] braceleftbt
  7396.  
  7397. "\bv"
  7398.      [0357] braceex
  7399.  
  7400. "\eu"
  7401.      [0360] euro
  7402.  
  7403. "\ra"
  7404.      [0361] angleright
  7405.  
  7406. "\is"
  7407.      [0362] integral
  7408.  
  7409. NONE
  7410.      [0363] integraltp
  7411.  
  7412. NONE
  7413.      [0364] integralex
  7414.  
  7415. NONE
  7416.      [0365] integralbt
  7417.  
  7418. NONE
  7419.      [0366] parenrighttp
  7420.  
  7421. NONE
  7422.      [0367] parenrightex
  7423.  
  7424. NONE
  7425.      [0370] parenrightbt
  7426.  
  7427. "\rc"
  7428.      [0371] bracketrighttp
  7429.  
  7430. NONE
  7431.      [0372] bracketrightex
  7432.  
  7433. "\rf"
  7434.      [0373] bracketrightbt
  7435.  
  7436. "\RT"
  7437.      [0374] bracerighttp
  7438.  
  7439. "\rk"
  7440.      [0375] bracerightmid
  7441.  
  7442. "\rb"
  7443.      [0376] bracerightbt
  7444.  
  7445.    Finally, there are escape sequences that apply only if the current
  7446. font is a Hershey font.  Most of these escape sequences provide access
  7447. to special symbols that belong to no font, and are accessible by no
  7448. other means.  These symbols are of two sorts: miscellaneous and
  7449. astronomical.  The escape sequences for the miscellaneous symbols are
  7450. as follows.
  7451.  
  7452. "\dd"
  7453.      daggerdbl
  7454.  
  7455. "\dg"
  7456.      dagger
  7457.  
  7458. "\hb"
  7459.      hbar
  7460.  
  7461. "\li"
  7462.      lineintegral
  7463.  
  7464. "\IB"
  7465.      interbang
  7466.  
  7467. "\Lb"
  7468.      lambdabar
  7469.  
  7470. "\~-"
  7471.      modifiedcongruent
  7472.  
  7473. "\-+"
  7474.      minusplus
  7475.  
  7476. "\||"
  7477.      parallel
  7478.  
  7479. "\s-"
  7480.      [variant form of s]
  7481.  
  7482. The final escape sequence in the table above, "\s-", yields a letter
  7483. rather than a symbol.  It is provided because in some Hershey fonts,
  7484. the shape of the lower-case letter `s' differs if it is the last letter
  7485. in a word.  This is the case for HersheyGothicGerman.  The German word
  7486. "besonders", for example, should be written as "besonder\s-" if it is
  7487. to be rendered correctly in this font.  The same is true for the two
  7488. Hershey symbol fonts, with their Greek alphabets (in Greek text,
  7489. lower-case final `s' is different from lower-case non-final `s').
  7490. In Hershey fonts where there is no distinction between final and
  7491. non-final `s', "s" and "\s-" are equivalent.
  7492.  
  7493.    The escape sequences for the astronomical symbols are listed in the
  7494. following table.  We stress that that like the preceding miscellaneous
  7495. escape sequences, they apply only if the current font is a Hershey font.
  7496.  
  7497. "\SO"
  7498.      sun
  7499.  
  7500. "\ME"
  7501.      mercury
  7502.  
  7503. "\VE"
  7504.      venus
  7505.  
  7506. "\EA"
  7507.      earth
  7508.  
  7509. "\MA"
  7510.      mars
  7511.  
  7512. "\JU"
  7513.      jupiter
  7514.  
  7515. "\SA"
  7516.      saturn
  7517.  
  7518. "\UR"
  7519.      uranus
  7520.  
  7521. "\NE"
  7522.      neptune
  7523.  
  7524. "\PL"
  7525.      pluto
  7526.  
  7527. "\LU"
  7528.      moon
  7529.  
  7530. "\CT"
  7531.      comet
  7532.  
  7533. "\ST"
  7534.      star
  7535.  
  7536. "\AS"
  7537.      ascendingnode
  7538.  
  7539. "\DE"
  7540.      descendingnode
  7541.  
  7542.    The preceding miscellaneous and astronomical symbols are not the only
  7543. special non-font symbols that can be used if the current font is a
  7544. Hershey font.  The entire library of glyphs digitized by Allen Hershey
  7545. is built into GNU `libplot'.  So text strings may include any Hershey
  7546. glyph.  Each of the available Hershey glyphs is identified by a
  7547. four-digit number.  Standard Hershey glyph #1 would be specified as
  7548. "\#H0001".  The standard Hershey glyphs range from "\#H0001" to
  7549. "\#H3999", with a number of gaps.  Some additional glyphs designed by
  7550. others appear in the "\#H4000"..."\#H4194" range.  Syllabic Japanese
  7551. characters (Kana) are located in the "\#H4195"..."\#H4399" range.
  7552.  
  7553.    You may order a table of nearly all the Hershey glyphs in the
  7554. "\#H0001"..."\#H3999" range from the U.S. National Technical
  7555. Information Service, at +1 703 487 4650.  Ask for item number PB251845;
  7556. the current price is about US$40.  By way of example, the string
  7557.  
  7558.      "\#H0744\#H0745\#H0001\#H0002\#H0003\#H0869\#H0907\#H2330\#H2331"
  7559.  
  7560. when drawn will display a shamrock, a fleur-de-lys, cartographic (small)
  7561. letters A, B, C, a bell, a large circle, a treble clef, and a bass
  7562. clef.  Again, this assumes that the current font is a Hershey font.
  7563.  
  7564.    You may also use Japanese syllabic characters (Hiragana and Katakana)
  7565. and ideographic characters (Kanji) when drawing strings in any Hershey
  7566. font.  In all, 603 Kanji are available; these are the same Kanji that
  7567. are available in the HersheyEUC font.  The Japanese characters are
  7568. indexed according to the JIS X0208 standard for Japanese typography,
  7569. which represents each character by a two-byte sequence.  The file
  7570. `kanji.doc', which is distributed along with the GNU plotting
  7571. utilities, lists the available Kanji.  On most systems it is installed
  7572. in `/usr/share/libplot' or `/usr/local/share/libplot'.
  7573.  
  7574.    Each JIS X0208 character would be specified by an escape sequence
  7575. which expresses this two-byte sequence as four hexadecimal digits, such
  7576. as "\#J357e".  Both bytes must be in the `0x21'...`0x7e' range in order
  7577. to define a JIS X0208 character.  Kanji are located at "\#J3021" and
  7578. above.  Characters appearing elsewhere in the JIS X0208 encoding may be
  7579. accessed similarly.  For example, Hiragana and Katakana are located in
  7580. the "\#J2421"..."\#J257e" range, and Roman characters in the
  7581. "\#J2321"..."\#J237e" range.  The file `kana.doc', which is installed
  7582. in the same directory as `kanji.doc', lists the encodings of the
  7583. Hiragana and Katakana.  For more on the JIS X0208 standard, see Ken
  7584. Lunde's `Understanding Japanese Information Processing' (O'Reilly,
  7585. 1993), and his on-line supplement (http://www.ora.com/people/authors/lunde/cjk_inf.html).
  7586.  
  7587.    The Kanji numbering used in A. N. Nelson's `Modern Reader's
  7588. Japanese-English Character Dictionary', a longtime standard, is also
  7589. supported.  (This dictionary is published by C. E. Tuttle and Co., with
  7590. ISBN 0-8048-0408-7.  A revised edition [ISBN 0-8048-2036-8] appeared in
  7591. 1997, but uses a different numbering.)  `Nelson' escape sequences for
  7592. Kanji are similar to JIS X0208 escape sequences, but use four decimal
  7593. instead of four hexadecimal digits.  The file `kanji.doc' gives the
  7594. correspondence between the JIS numbering scheme and the Nelson
  7595. numbering scheme.  For example, "\#N0001" is equivalent to "\#J306c".
  7596. It also gives the positions of the available Kanji in the Unicode
  7597. encoding.
  7598.  
  7599.    All available Kanji have the same width, which is the same as that of
  7600. the syllabic Japanese characters (Hiragana and Katakana).  Each Kanji
  7601. that is not available will print as an `undefined character' glyph (a
  7602. set of horizontal lines).  The same is true for non-Kanji JIS X0208
  7603. characters that are not available.
  7604.  
  7605. 
  7606. File: plotutils.info,  Node: Marker Symbols,  Prev: Text String Format,  Up: Text and Markers
  7607.  
  7608. Available marker symbols
  7609. ========================
  7610.  
  7611.    The GNU `libplot' library supports a standard set of marker symbols,
  7612. numbered 0 through 31.  These are the symbols that the `graph' program
  7613. will plot at each point of a dataset, if the `-S' option is used.  The
  7614. list is as follows (by convention, marker symbol #0 means no symbol
  7615. at all).
  7616.  
  7617.   1. dot
  7618.  
  7619.   2. plus (+)
  7620.  
  7621.   3. asterisk (*)
  7622.  
  7623.   4. circle
  7624.  
  7625.   5. cross
  7626.  
  7627.   6. square
  7628.  
  7629.   7. triangle
  7630.  
  7631.   8. diamond
  7632.  
  7633.   9. star
  7634.  
  7635.  10. inverted triangle
  7636.  
  7637.  11. starburst
  7638.  
  7639.  12. fancy plus
  7640.  
  7641.  13. fancy cross
  7642.  
  7643.  14. fancy square
  7644.  
  7645.  15. fancy diamond
  7646.  
  7647.  16. filled circle
  7648.  
  7649.  17. filled square
  7650.  
  7651.  18. filled triangle
  7652.  
  7653.  19. filled diamond
  7654.  
  7655.  20. filled inverted triangle
  7656.  
  7657.  21. filled fancy square
  7658.  
  7659.  22. filled fancy diamond
  7660.  
  7661.  23. half filled circle
  7662.  
  7663.  24. half filled square
  7664.  
  7665.  25. half filled triangle
  7666.  
  7667.  26. half filled diamond
  7668.  
  7669.  27. half filled inverted triangle
  7670.  
  7671.  28. half filled fancy square
  7672.  
  7673.  29. half filled fancy diamond
  7674.  
  7675.  30. octagon
  7676.  
  7677.  31. filled octagon
  7678.  
  7679. The interpretation of marker symbols 1 through 5 is the same as in the
  7680. well known GKS (Graphical Kernel System).
  7681.  
  7682.    Symbols 32 and up are interpreted as characters in a certain text
  7683. font.  For `libplot', it is the current font.  For `graph', it is the
  7684. font selected with the `--symbol-font-name' option.  By default, this
  7685. is the ZapfDingbats font except in `graph -T hpgl' and `graph -T tek'.
  7686. `graph -T hpgl' and `graph -T tek' currently have no access to
  7687. Postscript fonts, so they use the `HersheySerif' font instead.
  7688.  
  7689.    Many of the characters in the ZapfDingbats font are suitable for use
  7690. as marker symbols.  For example, character #74 is the Texas star.  Doing
  7691.  
  7692.      echo 0 0 1 2 2 1 3 2 4 0 | graph -T ps -m 0 -S 74 0.1 > plot.ps
  7693.  
  7694. will produce a Postscript plot consisting of five data points, not
  7695. joined by line segments.  Each data point will be marked by a Texas
  7696. star, of a large font size (0.1 times the width of the plotting box).
  7697.  
  7698.    If you are using `graph -T hpgl' and wish to use font characters as
  7699. marker symbols, you should consider using the Wingdings font, which is
  7700. available when producing HP-GL/2 output.  Doing
  7701.  
  7702.      echo 0 0 1 2 2 1 3 2 4 0 |
  7703.          graph -T hpgl -m 0 --symbol-font Wingdings -S 181 0.1 > plot.plt
  7704.  
  7705. will produce an HP-GL/2 plot that is similar to the preceding Postscript
  7706. plot.  The Wingdings font has the Texas star in location #181.
  7707.  
  7708. 
  7709. File: plotutils.info,  Node: Color Names,  Next: Metafiles,  Prev: Text and Markers,  Up: Appendices
  7710.  
  7711. Specifying Colors by Name
  7712. *************************
  7713.  
  7714.    Many of the plotting utilities allow colors to be specified by name.
  7715. For example, `graph' supports the `--frame-color' option.  `graph -T
  7716. hpgl' and `plot -T hpgl' check the value of the `HPGL_PENS' environment
  7717. variable, as do the HP-GL Plotters available in the `libplot' library.
  7718. Also, the `libplot' library includes the `pencolorname',
  7719. `fillcolorname', and `bgcolorname' functions.
  7720.  
  7721.    In any of these contexts, 665 distinct color names are recognized,
  7722. including obscure ones like "dark magenta", "forest green", and "olive
  7723. drab".  Color names are case-insensitive, and spaces are ignored.  So,
  7724. for example, "RosyBrown" is equivalent to "rosy brown", and
  7725. "DarkGoldenrod3" to "dark goldenrod 3".
  7726.  
  7727.    The file `colors.txt', which is distributed along with the GNU
  7728. plotting utilities, lists the available color names.  On most systems
  7729. it is installed in `/usr/share/libplot' or `/usr/local/share/libplot'.
  7730. The color names are essentially those recognized by recent releases of
  7731. the X Window System, which on most machines are listed in the file
  7732. `/usr/lib/X11/rgb.txt'.  However, for every color name containing the
  7733. string "gray", a version containing "grey" has been included.  For
  7734. example, both "dark slate gray 4" and "dark slate grey 4" are
  7735. recognized color names.
  7736.  
  7737. 
  7738. File: plotutils.info,  Node: Metafiles,  Next: Auxiliary Software,  Prev: Color Names,  Up: Appendices
  7739.  
  7740. The Graphics Metafile Format
  7741. ****************************
  7742.  
  7743.    GNU metafile format is produced by the raw variants of `graph',
  7744. `plot', `tek2plot', and plotfont, and by any other graphics application
  7745. that uses the Metafile Plotter support contained in GNU `libplot'.
  7746. A file in this format is a sort of audit trail: a sequence of plotting
  7747. commands, each of which may be followed by data.  Each plotting command
  7748. is an `op code': a single ASCII character, indicating a Plotter
  7749. operation.  The data following the command are the arguments passed to
  7750. the operation, if any.
  7751.  
  7752.    There are two sorts of GNU metafile: binary (the default) and
  7753. portable (human-readable).  Binary metafiles begin with the magic string
  7754. "#PLOT 1\n", and portable metafiles with the magic string "#PLOT 2\n".
  7755. If you wish to transfer metafiles between machines of different types,
  7756. you should use portable rather than binary format.  Portable metafiles
  7757. are produced by GNU `graph' and the other plotting utilities if the
  7758. `-O' option is specified, and by Metafile Plotters if the
  7759. `META_PORTABLE' parameter is set to "yes".  Both binary and portable
  7760. metafiles can be translated to other formats by GNU `plot'.
  7761.  
  7762.    In the portable format, the arguments of each operation (integers,
  7763. floating point numbers, or strings) are printed in a human-readable
  7764. form, separated by spaces, and each argument list ends with a newline.
  7765. In the binary format, the arguments are represented as integers, single
  7766. precision floating point numbers, or newline-terminated ASCII strings.
  7767. Using the newline character as a terminator is acceptable because each
  7768. `libplot' operation includes a maximum of one string among its
  7769. arguments, and such a string may not include a newline.  Also, the
  7770. string must come last among the arguments.
  7771.  
  7772.    The `openpl' and `closepl' operations open and close a Plotter,
  7773. i.e., begin and end a page of graphics.  They are represented by the
  7774. op codes `o' and `x', respectively.  Each of the other 79 Plotter
  7775. operations has a corresponding op code, with 10 exceptions.  These
  7776. exceptions include (1) the setup operations `flushpl' and `outfile',
  7777. (2) the operations `havecap', `labelwidth', and `flabelwidth', which
  7778. merely return information, and (3) the `colorname', `pencolorname',
  7779. `fillcolorname', and `bgcolorname' operations, which are internally
  7780. mapped to `pencolor', `fillcolor', and `bgcolor', and (4) the
  7781. `ffontname' operation, which in a metafile would be indistinguishable
  7782. from `fontname'.  So besides `o' and `x', there are 69 possible
  7783. op codes, for a total of 71.  The following table lists 10 of the
  7784. op codes other than `o' and `x', followed by the name of the `libplot'
  7785. operation they stand for.
  7786.  
  7787. Op Code
  7788.      Operation
  7789.  
  7790. `a'
  7791.      `arc'
  7792.  
  7793. `c'
  7794.      `circle'
  7795.  
  7796. `e'
  7797.      `erase'
  7798.  
  7799. `f'
  7800.      `linemod'
  7801.  
  7802. `l'
  7803.      `line'
  7804.  
  7805. `m'
  7806.      `move'
  7807.  
  7808. `n'
  7809.      `cont'
  7810.  
  7811. `p'
  7812.      `point'
  7813.  
  7814. `s'
  7815.      `space'
  7816.  
  7817. `t'
  7818.      `label'
  7819.  
  7820. The full set of 71 op codes is listed in the header file `plot.h',
  7821. which is distributed along with the plotting utilities.  On most
  7822. systems it is installed in `/usr/include' or `/usr/local/include'.
  7823.  
  7824.    It is worth noting that of the 71 op codes, only 46 are used in
  7825. portable metafiles.  That is because in ASCII format, there is no point
  7826. in distinguishing the floating point `libplot' operations from their
  7827. integer counterparts.
  7828.  
  7829.    The 10 op codes in the table above are actually the op codes of the
  7830. traditional `plot(5)' format produced by pre-GNU versions of `graph'
  7831. and `libplot'.  The use of these op codes make GNU metafile format
  7832. compatible with plot(5) format.  The absence of a magic string, and of
  7833. the `o' and `x' op codes, makes it possible to distinguish files in
  7834. plot(5) format from GNU metafiles.  GNU `plot' can convert files in
  7835. plot(5) format to GNU metafiles in either binary or portable format.
  7836.  
  7837. 
  7838. File: plotutils.info,  Node: Auxiliary Software,  Next: Acknowledgements,  Prev: Metafiles,  Up: Appendices
  7839.  
  7840. Obtaining Auxiliary Software
  7841. ****************************
  7842.  
  7843. * Menu:
  7844.  
  7845. * idraw::       Obtaining the idraw drawing editor
  7846. * xfig::        Obtaining the xfig drawing editor
  7847.  
  7848. 
  7849. File: plotutils.info,  Node: idraw,  Next: xfig,  Prev: Auxiliary Software,  Up: Auxiliary Software
  7850.  
  7851. How to get `idraw'
  7852. ==================
  7853.  
  7854.    The `idraw' utility mentioned several times in this documentation is
  7855. a freely distributable interactive drawing editor for the X Window
  7856. System.  It may be used to edit the output of `graph -T ps', or, in
  7857. general, the output of any application that uses the Postscript Plotter
  7858. support contained in `libplot'.
  7859.  
  7860.    The current version of `idraw' is maintained by Vectaport, Inc., and
  7861. is available at their Web site (http://www.vectaport.com).  It is part
  7862. of the `ivtools' package, which is a framework for building custom
  7863. drawing editors.  `idraw' was originally part of the `InterViews'
  7864. package, developed by Stanford University and Silicon Graphics.  The
  7865. `InterViews' package is available at a distribution site (ftp://interviews.stanford.edu) but is no longer supported.  Retrieving the
  7866. `ivtools' package instead is recommended.
  7867.  
  7868.    Also available at Vectaport's Web site (http://www.vectaport.com) is
  7869. an enhanced version of `idraw' called `drawtool'.  Unlike `idraw',
  7870. `drawtool' can import bitmapped graphics in PBM/PGM/PPM, TIFF, and X11
  7871. bitmap formats.
  7872.  
  7873. 
  7874. File: plotutils.info,  Node: xfig,  Prev: idraw,  Up: Auxiliary Software
  7875.  
  7876. How to get `xfig'
  7877. =================
  7878.  
  7879.    The `xfig' utility mentioned several times in this documentation is
  7880. a freely distributable interactive drawing editor for the X Window
  7881. System.  It may be used to edit the output of `graph -T fig', or
  7882. in general the output of any application that uses the Fig Plotter
  7883. support contained in `libplot'.
  7884.  
  7885.    The current version is available at
  7886. `ftp://ftp.x.org/contrib/applications/drawing_tools/'.  It can import
  7887. graphics in GIF, X11 bitmap, and Postscript formats.  Accompanying the
  7888. editor is a package called `transfig', which allows `xfig' graphics to
  7889. be exported in many formats.  GIF, X11 bitmap, LaTeX, and Postscript
  7890. formats are supported.
  7891.  
  7892.    There is a Web page on Fig format (http://duke.usask.ca/~macphed/soft/fig), which discusses application software packages that can
  7893. interoperate with `xfig'.
  7894.  
  7895. 
  7896. File: plotutils.info,  Node: Acknowledgements,  Prev: Auxiliary Software,  Up: Appendices
  7897.  
  7898. Acknowledgements
  7899. ****************
  7900.  
  7901.    Several of the GNU plotting utilities were inspired by Unix plotting
  7902. utilities.  A `graph' utility and various plot filters were present in
  7903. the first releases of Unix from Bell Laboratories, going at least as
  7904. far back as the Version 4 distribution (1973).  Most of the work on
  7905. tying them together and breaking out device-dependent versions of
  7906. `libplot' was performed by Lorinda Cherry <llc@research.att.com>.  By
  7907. the time of Version 7 Unix (1979) and the subsequent Berkeley releases,
  7908. the package consisting of `graph', `plot', `spline', and several
  7909. device-dependent versions of `libplot' was a standard Unix feature.
  7910. The first display device supported by the package was a Versatec
  7911. storage scope.  By the early 1980's, supported devices included
  7912. Tektronix storage scopes, 200dpi electrostatic printer/plotters from
  7913. Versatec and Varian, pen plotters from Hewlett-Packard, and early
  7914. graphics terminals.
  7915.  
  7916.    In 1989, Rich Murphey <rich@freebsd.org> wrote the first GNU
  7917. versions of `graph', `plot', and `spline', and the earliest
  7918. documentation.  Richard Stallman further directed development of the
  7919. programs and provided editorial support for the documentation.
  7920. John Interrante <interran@uluru.stanford.edu>, of the InterViews team
  7921. at Stanford, generously provided the `idraw' Postscript prologue now
  7922. included in `libplot', and helpful comments.  The package as it stood
  7923. in 1991 was distributed under the name `GNU graphics'.
  7924.  
  7925.    In 1995 Robert Maier <rsm@math.arizona.edu> took over development of
  7926. the package, and designed and wrote the current, maximally
  7927. device-independent, standalone version of `libplot'.  He also rewrote
  7928. `graph' from scratch, turning it into a real-time filter that would use
  7929. the new library.  He fleshed out `spline' too, by adding support for
  7930. splines in tension, periodicity, and cubic Bessel interpolation.
  7931.  
  7932.    Most development work on `ode' was performed by Nick Tufillaro <nbt@reed.edu> in 1978-1994, on a sequence of platforms that extended back
  7933. to a PDP-11 running Version 4 Unix.  In 1997 Robert modified Nick's
  7934. 1994 version to agree with GNU conventions on coding and command-line
  7935. parsing, extended it to support the full set of special functions
  7936. supported by `gnuplot', and extended the exception handling.
  7937.  
  7938.    Many other people aided the development of the plotting utilities
  7939. package along the way.  The Hershey vector fonts now in `libplot' are
  7940. of course based on the characters digitized in the mid to late 1960's
  7941. by Allen V. Hershey, who deserves a vote of thanks.  Additional
  7942. characters and/or marker symbols were taken from the SLAC Unified
  7943. Graphics System developed by Robert C. Beach in the mid-1970's, and
  7944. from the fonts designed by Thomas Wolff <wolff@inf.fu-berlin.de> for
  7945. Ghostscript.  The interpolation algorithms used in `spline' are based
  7946. on the algorithms of Alan K. Cline <cline@cs.utexas.edu>, as described
  7947. in his papers in the Apr. 1974 issue of `Communications of the ACM'.
  7948. The table-driven parser used in `tek2plot' was written at Berkeley in
  7949. the mid-1980's by Edward Moy <moy@parc.xerox.com>.  The `sagitta'
  7950. algorithm used in an extended form in `libplot' for drawing circular
  7951. and elliptic arcs was developed by Peter Karnow of URW and
  7952. Ken Turkowski <turk@apple.com> of Apple.  Ray Toy <toy@rtp.ericsson.se>
  7953. helped with the tick mark spacing code in `graph' and was the first to
  7954. incorporate GNU `getopt'.  Arthur Smith, formerly of LASSP at Cornell,
  7955. provided code for his `xplot' utility.  Nelson Beebe <beebe@math.utah.edu> exhaustively tested the package installation process.
  7956.  
  7957.    Robert Maier wrote the documentation, which now incorporates Nick
  7958. Tufillaro's `ode' manual.  Julie Sussmann checked over the
  7959. documentation for style and clarity.
  7960.  
  7961.  
  7962. 
  7963. Tag Table:
  7964. Node: Top1674
  7965. Node: Plotutils Intro2540
  7966. Node: graph10299
  7967. Node: Simple Examples11108
  7968. Node: Non-Square Plots23541
  7969. Node: Multiple Datasets26256
  7970. Node: Multiplotting31873
  7971. Node: Data Formats35458
  7972. Node: graph Invocation38186
  7973. Node: Plot Options39781
  7974. Node: Dataset Options55569
  7975. Node: Multiplot Options64779
  7976. Node: Raw graph Options66507
  7977. Node: Info Options67218
  7978. Node: graph Environment68520
  7979. Node: plot73992
  7980. Node: plot Examples74259
  7981. Node: plot Invocation76482
  7982. Node: plot Environment87215
  7983. Node: tek2plot92642
  7984. Node: tek2plot Introduction92939
  7985. Node: tek2plot Invocation94283
  7986. Node: tek2plot Environment104317
  7987. Node: plotfont108203
  7988. Node: plotfont Examples108496
  7989. Node: plotfont Invocation111942
  7990. Node: plotfont Environment119990
  7991. Node: spline124711
  7992. Node: spline Examples124989
  7993. Node: Advanced Use of spline132109
  7994. Node: spline Invocation136646
  7995. Node: ode146138
  7996. Node: Basic Math147472
  7997. Node: Simple ode Examples150354
  7998. Node: Additional ode Examples159416
  7999. Node: ode Invocation166416
  8000. Node: Diagnostics170467
  8001. Node: Numerical Error174586
  8002. Node: Running Time186349
  8003. Node: Input Language187678
  8004. Node: ODE Bibliography196037
  8005. Node: libplot196961
  8006. Node: libplot Overview197340
  8007. Node: C Programming206907
  8008. Node: The C API207371
  8009. Node: C Compiling and Linking213146
  8010. Node: Sample C Drawings214843
  8011. Node: Sample C Animations224906
  8012. Node: X Programming232481
  8013. Node: Functions238930
  8014. Node: Setup Functions240563
  8015. Node: Drawing Functions247101
  8016. Node: Attribute Functions257879
  8017. Node: Mapping Functions269311
  8018. Node: Driver Parameters271454
  8019. Node: Appendices284176
  8020. Node: Text and Markers284633
  8021. Node: Text Fonts285437
  8022. Node: Text Fonts in X295813
  8023. Node: Text String Format298993
  8024. Node: Marker Symbols317310
  8025. Node: Color Names319768
  8026. Node: Metafiles321195
  8027. Node: Auxiliary Software325092
  8028. Node: idraw325373
  8029. Node: xfig326575
  8030. Node: Acknowledgements327496
  8031. 
  8032. End Tag Table
  8033.